I need to Check variable is not less than zero
if ( $currentUserLimits >= 0 ) {
//do something
} elseif($currentUserLimits < $totalPurchaseUnitCount && $currentUserLimits not less then 0) {
//do something else.
} else {
//do something else.
}
Clear my question
This is all about offers apply on products and each customer have a purchases limit I have 2 variables and 3 cases.
$currentUserLimits
which will return the current customer limits. $totalPurchaseUnitCount
which will return the current purchases. My 3 cases.
$currentUserLimits still > 0
means the customer still have units in offer. Ex. $currentUserLimits = 15
and the $totalPurchaseUnitCount = 10
still the customer has 5 in his $currentUserLimits
. $currentUserLimits = 5
and the $totalPurchaseUnitCount = 10
. $currentUserLimits
is 0 or less then 0.Sorry making y'all read all this stuff but really the 3 cases confuses me.
how to write not less than 0
你已经在 ($currentUserLimits >= 0)
Check this out.
if ( $currentUserLimits >= 0 ) {
//do something
} elseif(($currentUserLimits < $totalPurchaseUnitCount) && !($currentUserLimits < 0)) {
//do something else.
} else {
//do something else.
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.