Thanks everybody for the help!🙂
It might be difficult to make ad show up by percentage of request (for example, 100 request show 30 randomly), I don't know how yet, for example how to let it show 30 ads randomly in 100 request?
maybe I will let it show up by percentage of chance,(for example,an ad has 30% chance to show).
I guess I can use rand() to make ads random, like this
$percent=30;
//percentage of the ads to show
$range=floor(100/30)
// range of numbers, for example,
// 30% means 3 request, only show one
$number=rand(1,$range);
{
if($number==1) // 1 has 30% to show up
//show ads here
}
Thanks!