Tried what you said....no go there either.. got a parse error. Still kept the $IMG string.
What I want is it to RANDMLY choose ALL files from the array. (like Shuffle in a CD-player) It will load ALL the files, but in a completely random order (no duplicates).
The code I have at the beginning of the thread works, but its too long. I figured an array would work, I just wasn't sure how to do it.
There is a shuffle () command as well, but I'm bot sure of the syntax in PHP.
Here's the code based on what you stated:
<?
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
srand( time() );
$item = rand( 0, count($ads) - 1 ); // starting index into array
for ($i = 0; $i < count($ads); $i++, $item )
{
include( $ads[ $item % count($ads)] );
}
?>
FYI : I'm using the $img string so I can see all the files in the array easier. Otherwise it will be a repetitive nightmare for me to add and delete some of these files. (They're advertisers - so if they dont Pay, they get pulled from the site).