Answers for "foreach array in constants.php"

PHP
4

how to iterate through php array

$ar = ['Rudi', 'Morie', 'Halo', 'Miki'];

for ($i=0, $len=count($ar); $i<$len; $i++) {
    echo "$ar[$i] \n";
}
/*
Rudi 
Morie 
Halo 
Miki 
*/
Posted by: Guest on January-16-2020

Browse Popular Code Answers by Language