php - Echo Arrays in Array -
i have array mutltiple arrays in it. tried echo each of them "array" instead of values saved inside of each arrays.
my array looks this:
$arrays = [['test1','test2'],['test3','test4']]; foreach($arrays $array) { echo $array, '<br>'; }
i get:
array array
instead of
test1,test2 test3,test4
you're not printing content of inner arrays - try this:
$arrays = [['test1','test2'],['test3','test4']]; foreach($arrays $array) { echo implode(',', $array) . '<br>'; }
oh, , why not print_r($arrays)
?
Comments
Post a Comment