Created
March 26, 2013 21:26
-
-
Save ryarwood/5249427 to your computer and use it in GitHub Desktop.
Shuffle array and spit out X number
This file contains hidden or 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
/* set vars */ | |
$numbers = range(1, 9); | |
shuffle($numbers); | |
$imgString = "/img/header-side-default"; | |
/* loop */ | |
foreach($numbers as $arr) { | |
$i++; | |
echo '<img src="'.$imgString.$arr.'.jpg" width="715" height="320" />'; | |
if ($i == 3) break; /* change 3 to how many you want! */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment