Randomize your banner ads


/ Published in: PHP
Save to your folder(s)

You have banners on your page for advertising? Then you have to randomize the order to be fair.


Copy this code and paste it in your HTML
  1. <?$arr = array(
  2. 0 => "<p>Fill with your html for the first banner</p>",
  3. 1 => "<p>Fill with your html for the 2nd banner</p>",
  4. 2 => "<p>Fill with your html for the 3rd banner</p>"
  5. );
  6.  
  7. // Don´t touch
  8. // Print insertet banner-HTML
  9. shuffle($arr);
  10. foreach($arr as $banner => $value)
  11. {
  12. print $value;
  13. }
  14.  
  15. // Thats it!

URL: http://www.shopbetreiber-blog.de

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.