Me: I’m getting faster at whipping out the python
Mike: nice
Mike: lol
Me: oh that sounded bad
Me: srsly didnt mean it THAT way
Me: lol
Mike: well you know when its that big you have to come up with procedures for whipping it out speedily without getting injured
Me: LOL
So, I recently had a need to randomly redirect a page on occasion…don’t ask.
< ?php
$case = mt_rand(1,100);
switch($case) {
case 42:
$url = "http://notalwaysright.com/?random";
break;
case 13:
$url = "http://icanhascheezburger.com/?random";
break;
case 66:
$url = "http://dynamic.xkcd.com/comic/random/";
break;
case 73:
$url = "http://bash.org/?random";
break;
case 100:
$url = "http://linux.die.net/man/4/random";
break;
default:
$url = "http://www.google.com/";
}
header("Location: " . $url);
?>