- Impact
- 91
hi
i am trying to create a simple adsense rotation script which would display the ads in a certain ratio
if i have to distribute the ads in 50-50% ratio then i would follow this
but the problem is suppose i want to distribute the ads into a certain ratio of say 70-30%
then should i do it manually by using
and then using if statement to print out "code 1" 7 times and "code 2" 3 times?
or is there any better and more efficient way to do this all?
i am trying to create a simple adsense rotation script which would display the ads in a certain ratio
if i have to distribute the ads in 50-50% ratio then i would follow this
Code:
<?php
$rand = rand(1,2);
if ($rand == 1)
print 'adsense code 1';
elseif ($rand == 2)
print 'adsense code 2;
?>
but the problem is suppose i want to distribute the ads into a certain ratio of say 70-30%
then should i do it manually by using
Code:
rand(1,2,3,4,5,6,7,8,9,0)
or is there any better and more efficient way to do this all?







