1$clothes = array("hat","shoe","shirt");
2foreach ($clothes as $item) {
3 echo $item;
4}
1for ($i = 0; $i < count($array); $i++) {
2 echo $array[$i]['filename'];
3 echo $array[$i]['filepath'];
4}
1foreach (array_expression as $value)
2 statement
3foreach (array_expression as $key => $value)
4 statement
5
1foreach($array as $item) {
2 echo $item['filename'];
3 echo $item['filepath'];
4
5 // to know what's in $item
6 echo '<pre>'; var_dump($item);
7}