View Single Post
Old 12-09-2010, 09:06 PM  
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by woj View Post
using array_rand is probably more straightforward...
Certainly takes out some minor overhead by calling count() manually for each parse. I'd suggest this as well for something as simple-tarded as mentioned.

Code:
<?php
$urls = array(
        'http://www.google.com',
        'http://www.msn.com',
        'http://www.bing.com',
        'http://www.webcrawler.com',
        'http://www.dogpile.com',
);
header("location: ". array_rand(array_flip($urls), 1));
?>
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote