for every array element php code example
Example 1: php foreach echo key value
foreach($page as $key => $value) {
echo "$key is at $value";
}
Example 2: 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
*/