1) { $tabimages=array("jpg","jpeg","gif","png"); foreach($visuels as $visuel) { $photos=explode("/",$visuel); $photo=$photos[count($photos)-1]; $exts=explode(".",$visuel); $ext=strtolower($exts[count($exts)-1]); if(in_array($ext, $tabimages)) { ?>