A Random-Image Script Using array_rand()
<HTML>
<HEAD><TITLE>A random image script</TITLE></HEAD>
<BODY>
<?php
srand((double)microtime()*1000000);
$images = array('image1.jpg', 'image2.jpg', 'image3.jpg');
$rImage = array_rand($images)
?>
<IMG SRC="<?php echo $images[$rImage]; ?>">
</BODY>
</HTML>
Related examples in the same category