I've try to randomize an array with rand()but it keep returning the same number several time.
After several times trying i gave up and try to use the shuffle().
Can anybody please explain to me what "$item" doing in the for loop.
Is there any other way to do randomizing an array without getting the same element in the array twice?
Thank YOU!
srand (time());
$img="/php/SC/img";
$ads = array( "$img/softnet.htm","$img/wiremix.htm","$img/igm.htm","$img/globalinteractive.htm","$img/gocall.htm","$img/1stgenx.htm","$img/poker.htm","$img/realtime.htm","$img/dotcoment.htm","$img/goldplay.htm","$img/i-net.htm","$img/iiga.htm","$img/iql.htm","$img/sri.htm");
// array of filenames
//shuffle and reset array
shuffle($ads);
reset($ads);
//loop through shuffled array
for ($i = 0; $i < count($ads); $i++, $item )
{
include( $ads[$i]);
}