php - remove "resourse id #--" from image name -
when displaying(php echo) image name server,it's shows like,
resource id #32global_2012062513406170744fe83172d6c99.jpg resource id #33330394727_2012062613406707734fe90335d0a5e.jpg
how can remove "resource id #32" associated image name? can display image server? or there other way display images? code is
69 if(is_dir($dir)) 70 { 71 $dir = opendir($dir); 72 while (false !== ($file = readdir($dir))) 73 { 74 if ($file != "." && $file != "..") 75 { 76 $files[] = $file; 77 } 78 } 79 closedir($dir); 80 } 81 //srand ((double) microtime( )*1000000); 82 $randnum = mt_rand(0,(sizeof($files)-1)); 83 $img = $dir.$files[$randnum]; 84 echo $img;
thanks!
if(is_dir($dir)) { $opendir = opendir($dir); while (false !== ($file = readdir($opendir))) { if ($file != "." && $file != "..") { $files[] = $file; } } closedir($opendir); } //srand ((double) microtime( )*1000000); $randnum = mt_rand(0,(sizeof($files)-1)); $img = $dir.$files[$randnum]; echo $img;
use this.
Comments
Post a Comment