...

View Full Version : Rotating Images?



_Josh_
04-29-2006, 10:43 AM
Can Any One Tell Me Where Can i Find.. A Script...

Like.. It Should From a List Of Image's Randomly Select Image and Display...

Each Time I Refresh An The Page A Different Image Should Dispaly :confused:

cdwhalley.com
04-29-2006, 11:57 AM
$image_array = array("filename1.jpg", "filename2.jpg", "filename3.jpg");

$random_max = count($image_array) - 1;
$random_number = rand(0, $random_max);

echo "<img src=\"". $image_array[$random_number]. "\"/>";

trib4lmaniac
04-29-2006, 09:09 PM
$image_array = array("filename1.jpg", "filename2.jpg", "filename3.jpg");

$random_max = count($image_array) - 1;
$random_number = rand(0, $random_max);

echo "<img src=\"". $image_array[$random_number]. "\"/>";



$images= array("filename1.jpg", "filename2.jpg", "filename3.jpg");
echo '<img src="'. $images[array_rand($images)]. '"/>';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum