Simple Banner Rotation

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

Copy this code and paste it in your HTML
  1. <?php
  2. $bannerAd[1] = '<a href="[~267~]"><img src="banner1.png" alt="Banner1" /></a>';
  3. $bannerAd[2] = '<a href="[~265~]"><img src="banner2.png" alt="Banner2" /></a>';
  4. $adCount = count($bannerAd);
  5. $randomAdNumber = mt_rand(1, $adCount);
  6. echo $bannerAd[$randomAdNumber];
  7. ?>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.