<?php function rand_logos ($patch="pic/ logos/") { if(!$dir= opendir($patch)) return"Этоне директория"; while(($t= readdir($dir))! ==false) { $ext=substr (strrchr ($t,'.'),1); if(is_file($t) &&($ext== "gif")||($ext =="jpg")|| ($ext=="png")) { $filename[]= $patch."/".$t; } } closedir($dir); $index=rand(0, count($filename) -1); $foto="<img src=".$filename [$index].">"; return$foto; } echorand_logos (); ?>