Answers for "for loop program in php with array"

PHP
1

php array loop

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

    // $array[$i] is same as $item
}
Posted by: Guest on May-05-2020
13

php loop through array

foreach (array_expression as $value)
    statement
foreach (array_expression as $key => $value)
    statement
Posted by: Guest on May-26-2020

Browse Popular Code Answers by Language