Created
November 19, 2015 09:59
-
-
Save oliwa/2ee95eef4b4531aa6dbb to your computer and use it in GitHub Desktop.
Random Select
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
<!-- load a random image --> | |
<figure> | |
<img src="/images/visual-<?php echo(rand(1,5)); ?>" /> | |
</figure> | |
<!-- Display random snippet --> | |
<?php | |
$snippet[] = '<h2>Snippet 1</p>'; | |
$snippet[] = '<h2>Snippet 2</p>'; | |
$snippet[] = '<h2>Snippet 3</p>'; | |
srand ((float) microtime() * 10000000); | |
print $snippet[array_rand($snippet)]; | |
?> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment