1
I need to convert this Array:
Array
(
[0] => Array
(
[value] => pdf
[label] => PDF
)
[1] => Array
(
[value] => csv
[label] => CSV
)
[2] => Array
(
[value] => rtf
[label] => RTF
)
)
In a String bringing only the label separated by comma. Ex:
PDF, CSV, RTF
I used two foreachs
concatenating into a variable and space and comma, and a substr
to remove the first comma.
Ex:
foreach ($formatos as $row[label]){
foreach ($row as $formato => $a){
$b .= ', '.$a[label];
}
}
echo $arq = substr($b, 1);
There must be an easier way to do this?