How would I go about creating a banner rotator through which i could controll the probablility of an ad appearing? I can create a script to display a random ad each time, but I'm not sure on creating a script with probability. I though the array of ads would look like this:
PHP Code:
# $banners = array("link","img",probability);
$banners = array("banner1.php","banner1.gif",0.5);
$banners = array("banner2.php","banner2.gif",0.25);
$banners = array("banner3.php","banner3.gif",0.25);
In this example banner 1 would be shown half the time, and banner 2 and 3 a quarter of the time. I'm just not sure how the rest would work
Please help if you have a rough idea.