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










abu said on January 21, 2010
How do I check for non numerical characters i.e. abc etc i know its ok for numbers.
Linker1988 said on January 19, 2011
If you want to check a string you can use the function strlen()
it will count how big a string is so for ex
$Str = “abc”;
$Count = strlen($Str);
echo $Count;
result will be 3