Return to Snippet

Revision: 31319
at September 3, 2010 00:30 by wireplay


Initial Code
<?php
//total number of images
$totalimages = "300";
//file type
$file_type = ".jpg";
//location
$image_folder = "../assets/images/";
//start counting from number
$startcounter = "1";
$random = mt_rand($startcounter, $totalimages);
$image_name = $image_folder . $random . $file_type;
?>
<img src="<?php echo $image_name; ?>" name="image<?php echo $random; ?>" width="" height="" border="0" id="image<?php echo $random; ?>" alt="" />

Initial URL

                                

Initial Description

                                

Initial Title
PHP - Random Image

Initial Tags
php, image

Initial Language
PHP