I am trying to test a variable to determine whether a number (as opposed to an alpha or other character) is present. I use the following code to test for single alpha chars:
if (("a" <= $ModSuffix && $ModSuffix <= "z") || ("A" <= $ModSuffix && $ModSuffix <= "Z"))
This seems to work well in isolating alpha chars. I tried the following to isolate numbers in the same variable:
if (($ModSuffix > 0) || ($ModSuffix < 100000)) { //must be a number
Unfortunately, this test allows non-numeric chars through (such as ~,,(,),|, etc.) I'm guessing there is some simple PHP command that I'm just missing, but I defer to the greater knowledge of the overall collective. Any ideas?
Thanks,
Lenny