Random Single Image Display On Page Reload Using PHP
June 18th, 2008 | by King | Posted in » Randomizing, Rotating Content
Very small yet wow kind of script that takes a folder and displays random script image at every time page reloads.
PHP Code
<?php $files = glob("images/*.*"); mt_srand( (double) microtime() * 1000000 ); $num = mt_rand(0, count($files)-1); echo '<img src="'.$files[$num].'" alt="" />'; ?>
In this example ‘images’ is the folder containing all the images. Every time page reloads, it will display different image.
Random Single Image On Page Reload PHP Script Download
Tags: image, random, rotaters, Rotating Content
Posted in: Randomizing, Rotating Content
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
Posted in: Randomizing, Rotating Content
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0
