Programming Wiki: Display Random Images

Programming Wiki : PHPDisplayRandomImages

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

Display Random Images

PHP


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?

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

Powered by Wikka Wakka Wiki 1.1.6.0
Page was generated in 0.0209 seconds