Very Simple Image Randomiser

<img src="images/image_<?php $random = rand(1,2); echo $random; ?>.jpg" alt="Image Alt Tag" height="500" width="500" />
Simply, use this image tag and replace the min and max parameters in the rand argument i.e. rand(1,2) - change the '2' to however how many images there are in your folder and voila it will randomly generate one of these image each time you refresh the page.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.