Thursday, December 19, 2024
HomeWeb application programmingPHP programmingPHP conditional syntax: greater than

PHP conditional syntax: greater than

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

if ($var > 0)
echo "var is positive and non-zero";

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

if ($var >= 0)
echo "var is positive";

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 !!