1$clothes = array("hat","shoe","shirt");
2foreach ($clothes as $item) {
3 echo $item;
4}
1$ar = ['Rudi', 'Morie', 'Halo', 'Miki'];
2
3for ($i=0, $len=count($ar); $i<$len; $i++) {
4 echo "$ar[$i] \n";
5}
6/*
7Rudi
8Morie
9Halo
10Miki
11*/
1foreach (array_expression as $value)
2 statement
3foreach (array_expression as $key => $value)
4 statement