Thursday, November 21, 2024
HomeWeb application programmingPHP programmingPHP 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";

Quinn McHenry
Quinn McHenry
Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

LATEST REVIEWS

Recent Comments

error: Content is protected !!