Fixing another ad rotator
Posted: Mon Apr 05, 2010 1:07 pm
Ok I have this old code block, it shows ads from a text file, but it shows them all, I only wanted a random pick, what I am doing wrong?
Code: Select all
<?php
// This one uses a text file for the ads
$fcontents = join ('', file ('banner_ads.txt'));
$s_con = split("~",$fcontents);
$banner_no = rand(0,(count($s_con)-1));
echo $s_con[$banner_no];
?>