Using foreach loop without key foreach($array as $item) { echo $item['filename']; echo $item['filepath']; // to know what's in $item echo ... ... <看更多>
If you are worried about modifying the array while looping, don't because foreach copies the array. Try $array = array('foo'); foreach ($array as $k ... ... <看更多>