Created
March 28, 2012 05:34
-
-
Save powdahound/2223915 to your computer and use it in GitHub Desktop.
Image randomizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$image_urls = array( | |
'http://b.thumbs.redditmedia.com/crFh5ZpigMuuO68U.png', | |
'http://i.imgur.com/Boqat.png', | |
'http://i.imgur.com/gwfE3.png', | |
'http://i.imgur.com/WRBMg.png', | |
'http://i.imgur.com/C1fqv.png', | |
'http://i.imgur.com/Ycc5g.png', | |
'http://i.imgur.com/wsow1.png' | |
); | |
if (isset($_GET['random'])) { | |
// random each time | |
$index = array_rand($image_urls); | |
} else { | |
// changes each day | |
$index = date('j') % count($image_urls); | |
} | |
header('Location: '.$image_urls[$index]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment