Cita:
Iniciado por xbx
Código PHP:
$cantidad = file_get_contents("ads/cant.txt");
$ads_cant=$cantidad>6?6:$cantidad;
$ad = range(0,$ads_cant);
$ad = shuffle($ad);
La simplicidad ante todo.
La función
shuffle recibe un
array por referencia y devuelve un valor booleano que indica el éxito. Al asignárselo a la variable
$ad estarías perdiendo el
array. ¡Suerte!