1) $rfile = $listfiles[mt_rand(1, count($listfiles))]; else $rfile =$listfiles[1]; @array_splice($listfiles,0); return $rfile; } ?>