I have a script that loads 13 or more file names into an array. Then at random I select one of the names out of the array. This files are background songs used on my webpage. Streaming a different song each time the page is refreshed or loaded. My issue is I do not want the same song to ever be played back to back. How can I check for that and if the random file chosen is the currently played file then pick another......
Here is what I have so far. <?PHP $Music = array("bk1.swf","bk2.swf","bk3.swf","bk4.swf","bk5.swf","bk6.swf","bk7.swf" ,"bk8.swf","bk9.swf","bk10.swf","bk11.swf","bk12.swf","bk13.swf"); srand((float) microtime() * 100000000000); $rand_keys = array_rand ($Music, 2); $MusicToPlay = $Music[$rand_keys[0]]; ?> How do I pass the variable to the next page easily so that PHP will know what is currently being played? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php