PHP Code:
<?php
ob_start();
list($num, $url) = array(mt_rand(0, 1), array('http://www.yahoo.com/', 'http://www.google.com/'));
header("Location: $url[$num]"); ob_flush(); exit();
?>
Use the url array to store the address you want to redirect to. The first parameter of mt_rand() must be zero, because the first index of an array is always 0 then, 1, 2, 3, etc. You'll want the second parameter to be total number items in the array. Don't forget the first item in the array is indexed as 0.