PHP script to change images on page refresh
In this tutorial i am going to show you how to change images dynamic on each time you refresh your page.
There is simple PHP script to get it working.
srand( microtime() * 1000000 );
$num = rand(1,2);
switch($num)
{
case 1:
$imageName = "image1.jpg";
break;
case 2:
$imageName = "image2.jpg";
break;
}
echo "<img src=images/".$imageName." />";
Please support us, Like us on Facebook.
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment