Jump to content

php if elseif


jarvis

Recommended Posts

Hi,

 

I can't see for looking on quite simply a very easy statement;

$cartTotal = '900';
echo 'cart total '.$cartTotal.'<br/>';

$postage = '100';
echo 'Postage '.$postage.'<br/>';

$postThreshold = '85';
echo 'Post Threshold '.$postThreshold.'<br/>';

if ($cartTotal <= $postThreshold) {

echo 'too little';

} elseif (($cartTotal >= $postThreshold) || ($cartTotal <= $postage)) {

echo 'difference';

} else {

echo 'over a ton';

}

It works apart from if the cart total is above 100. What have I missed?

Thanks

Link to comment
https://forums.phpfreaks.com/topic/232161-php-if-elseif/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.