Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Showing ads only to 20% percent of visitors


httpwebwitch - 1:16 pm on Jul 31, 2012 (gmt 0)


<?php
$percent = 0.2;

if (rand(0,100) < (100*$percent)){
// show ads
} else {
// something else
}

?>


like topr8 said. doing things proportionally is best done using a rand()


Thread source:: http://www.webmasterworld.com/php/4480465.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com