Posted By

landonmiller on 02/15/10


Tagged

php banner rotation


Versions (?)

Rotate image on page refresh


 / Published in: PHP
 

  1. <?php
  2. $rotate[] = "<img src='images/1.jpg' alt='' border='0' width='405' height='107' />";
  3. $rotate[] = "<img src='images/2.jpg' alt='' border='0' width='405' height='107' />";
  4. $rotate[] = "<img src='images/3.jpg' alt='' border='0' width='405' height='107' />";
  5. $rotate[] = "<img src='images/4.jpg' alt='' border='0' width='405' height='107' />";
  6.  
  7. $number = rand(0, sizeof($rotate) - 1);
  8.  
  9. echo $rotate[$number];
  10. ?>

Report this snippet  

You need to login to post a comment.