Trying to make this script go random. I tried variations of this string $banner_no = rand(1,$max)-1;
<div id="header_banner_ad">
<?php
$fcontents = join ('', file ('FILENAME'));
$s_con = split("~",$fcontents);
$banner_no = rand(1,(count($s_con)-1));
echo $s_con[$banner_no];
?>
</div>
I’m not entirely sure what to do.
If you wan’t to select a random element from an array you could use
array_rand()Example: