Programming Wiki: Display Random Images

Programming Wiki : PHPDisplayRandomImages

WikiHomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Most recent edit on 2006-04-16 20:21:12 by ScottRippee

Additions:

PHP



Deletions:

PHP





Edited on 2005-10-11 08:40:32 by 12.44.178.253

Additions:

PHP

Display Random Images



Deletions:

Display Random Images





Oldest known version of this page was edited on 2005-09-30 21:00:33 by ScottRippee []
Page view:

Display Random Images


This is so simple. I name my images that I want randomly displayed logo followed by a number from 0 to how ever many images you want displayed randomly followed by the extention. Change the mt_rand function so that it matches the number of random images.

<?php
   echo "<img border=0 src=./gfx/logo";
   echo mt_rand(0,6);
   echo ".png>";
?>


Hmmm, this probably does not need to be on three lines. Just one with periods between each?
Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.0418 seconds