Forum Moderators: coopster
$current_email = 0;
$email_quota = 5000;
if($email_percent = round(($current_email/$email_quota)*100,0)) {
$email_percent = "Unlimited";
}
echo $email_percent;
if(!$email_percent = ...
$current_email = "0";
$email_quota = "5000";
true on 1
true on -1
<?php
$current_email = 0;
$email_quota = 5000;
if(($email_percent = round(($current_email/$email_quota)*100,0))) {
$email_percent = "Unlimited";
}
echo $email_percent;
// 0 divided by -.- I should look at things in more detail. :/
?>
round(($current_email/$email_quota)*100,0) is equal to zero - which is subsequently being interpreted as false. Notice how it is not true for the 0 case.
if(($email_percent = round(($current_email/$email_quota)*100,0)))
{$email_percent = "Unlimited";}
echo $email_percent;