Posted By

stasiaholdren on 06/30/06


Tagged

random rotate


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

luxuryluke
1man
jkochis


HTML Rotator


 / Published in: PHP
 

Put rotating content within the parenthesis below, and surround it by quotes followed by a comma. These items can contain HTML.

  1. $dyk = array(
  2. "Content 1", "Content 2", "Content 3",
  3. );
  4.  
  5. //now pick a random piece
  6. $i = sizeof($dyk);
  7. srand((double)microtime()*1000000);
  8.  
  9. //show our random piece
  10. echo $dyk[rand(0,$i - 1)];

Report this snippet  

You need to login to post a comment.