Home Web application programming PHP programming PHP conditional syntax: less than

PHP conditional syntax: less than

To determine if a value is less than another value, use:

if ($var < 0) echo "var is negative and non-zero";

To determine if a value is less than or equal to another value, use:

if ($var <= 0) echo "var is negative";

LEAVE A REPLY

Please enter your comment!
Please enter your name here

error: Content is protected !!