Programming Wiki: Display Random Images

Programming Wiki : PHPDisplayRandomImages

WikiHomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

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.

   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?

There are no comments on this page. [Add comment]

Powered by Wikka Wakka Wiki
Page was generated in 0.0133 seconds