PHP conditional syntax: greater than

Contributor Icon Contributed by qmchenry  
Tag Icon Tagged: PHP programming  

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";

 

No Comments -


No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment -