I do it like this:
<?
$urls = file ("random.txt"); //replace with the name of your file
srand(time());
$count = count($urls);
$random = (rand()%$count);
Header("Location: $urls[$random]");
?>
random.txt contains a list of URLs.
You could put the URLs into an array in the code if you prefer. I have them in a separate file so I can use them from other code.
Example is in my sig.