You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to implode a two-dimensional array in PHP?

Practice




as in php implode for a two-dimensional array?

you can do it like this

function ImplodeArrayDimention2($arr, $field, $separate = ', ')
{
foreach ($arr as $value)
{
$str .= $value[$field] . $separate;
}
$str = substr($str, 0, -2);
return $str;

}

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)