ScriptPlazzaon Google+

If you have more than one banner that you want to display on your site in random order use following snippet.

$ads = array();

$ads[] = '<a href=""><img src="banner1.jpg"></a>';
$ads[] = '<a href=""><img src="banner2.jpg"></a>';
$ads[] = '<a href=""><img src="banner3.jpg"></a>';
$ads[] = '<a href=""><img src="banner4.jpg"></a>';
$ads[] = '<a href=""><img src="banner5.jpg"></a>';

echo $ads[0];
echo $ads[1];
echo $ads[2];
echo $ads[3];
echo $ads[4];

Leave a Comment

You must be logged in to post a Review.