Very Simple Random Image Php Script

Some times my friends asking me about random image php scripts which is better and which is simple,here im giving you a very very simple script,

In this script we are using random number insted of image,means this script displays random number,we are changing that for image rotation, now we can check how ?

GET RANDOM NUMBER CODE

<?php
$number=rand(1,10);
echo $number;
?>

The above code will echo 1 to 10 number for each refresh,if your images in same folder and the images have a name with number you can echo random numbers

IMAGE FILES MUST BE CONTAIN NUMBERS LIKE

Image_file_name_1.jpg
Image_file_name_2.jpg
Image_file_name_3.jpg
Image_file_name_4.jpg
Image_file_name_5.jpg etc

CODE FOR RANDOM IMAGE DISPLAYING

<img src="http://www.9t9.in/folder/Image_file_name_<?php echo $number;?>.jpg">