I think you have a typo in your substr which should be
substr($x,0,1);
Otherwise the case $x=0; falls into the not a number part of the if.
In reply to Re: Re: Checking whether a $var is a number
by dga
in thread Checking whether a $var is a number
by George_Sherston
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |