$repertoire = "../../photos/entete"; ?> $handle = opendir($repertoire); while ($file = readdir($handle)) { if(preg_match ("!(\.jpg|\.jpeg|\.gif|\.bmp|\.png|\.tiff)$!i", $file)) { $photos[] = $file; } } closedir($handle); rand(0, count($photos)); $random_img = rand(0, count($photos) - 1); ?>
Page valide XHTML 1.0 Strict et CSS2