Mas q esto No creo q aya -.-
Código PHP:
<?php
/*
********************************
* Created By RuzZ *
* Open Source *
********************************
*/
$dir='favorites/';
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if (!is_dir($dir.$file) && $file != "." && $file != "..") {
$archivos[]=substr(urlencode($file), 0, strlen(urlencode($file))-4);
}
}
closedir($handle);
}
/*|RuzZ And Paty|*/
$cantidad=count($archivos)-1;
for($i=0;$i<=$cantidad;$i++)$lenght+=strlen($archivos[$i].",");
$random="";
while($lenght!=strlen($random))
{
for($i=0;$i<=$cantidad;$i++)
{
$rand=mt_rand(0,$cantidad);
$posision=substr_count($random,$rand.",");
if($posision==false)
{
$random.=$archivos[$rand].",";
}
}
}
$cadena=substr($random,0,-1);
$aleatorio=explode(",",$cadena);//new array random elemments
//---
print_r($aleatorio);
?>