Umm ... Either I'm losing it, or you mean what you want below ...
$chance = 40;
if ($chance >= 40){
echo "event happened";
} else {
echo "event didn't happened";
}
This suggests that the probability is equal to or greater than 40.
If you want randomness to be randomly generated, use something like $chance = rand(0,100);for a random number from 0 to 100 - then just use if statements to fulfill the conditions.
, $chance , ... , ...