Here's a real simple way to do it:
Code:
<?php
$urlArray = array(
"http://whatever",
"http://whatever",
"http://whatever",
"http://whatever",
"http://whatever",
"http://whatever",
"http://whatever",
);
header("location: ".$urlArray[mt_rand(0, count($urlArray)-1)]);
?>
This doesn't do that great for weighting.
If you want to do some weighting, some pseudo code (ugly) could be as follows:
Code:
$count = ceil(100/count($urlArray));
$randchoice=rand(count($urlArray)%$count,0)-1;
Never did bother checking the graulatity of the above code snippit in practice, though, though. It should give roughly an even (rounded up) percentage to either one, since PHP's rand() tends to suck with smaller subsets.
Make DAMN sure you just use a location: redirect, which is a 301. Google won't penalize you for those.