I'd like to know if this stands correctly, I am wanting to set rand(1,100) to be 100 for specific pages and I'm unsure if I have done it correctly..
$rand = rand(1, 100);
if( basename($_SERVER['PHP_SELF'], '.php') == 'index' ) #index.php
{
$rand = 100;
}
if ($rand > 20)
{
echo 'Yes it works';
} else {
echo 'no it does not work';
}
So if index.php loads, will $rand be set to 100 always with the if statement that I wrote? or would it need to be $rand > 100;