link to netboffin homepage

Display Random Images with PHP

It's a three step process
  1. Put your images in an array
  2. Shuffle the array with the shuffle function
  3. Display the images
<?php 
		$images = array("image1.jpg",
			"image2.jpg",
			"image3.jpg",
			"image4.jpg",
			"image5.jpg",
			"image6.jpg",
			"image7.jpg"
			);
 
//shuffle the image	array	
shuffle($image);
 
//display the images
for($i=0;$i=3;$i++)
{
 
	echo "<img src=".$images[$i]."/>";
 
}	
 
?>

random imagebox-top.gifrandom imagecontent2.jpgrandom imagenav-top.gif