foreach on an array php code example Example: php loop through array foreach($array as $item=>$values){ echo $values->filepath; }