Answers for "php foreach array as array"

PHP
1

php foreach string in array

foreach($array as $item) {
    echo $item['filename'];
    echo $item['filepath'];

    // to know what's in $item
    echo '<pre>'; var_dump($item);
}
Posted by: Guest on May-05-2020
0

php assign an array inside a foreach loop

$data = array_fill_keys($input, 50);
Posted by: Guest on July-26-2021

Browse Popular Code Answers by Language