Re: [PHP-WIN] Re: How to check if a *string* has only numbers...

2004-11-19 Thread Luis Moreira
Better yet, use the right function :-) This script $a = "1234567890"; $b = $a.$a; $c = $a."A"; echo "$a "; if (!is_numeric($a)) echo "NOT "; echo "numeric"; echo "$b "; if (!is_numeric($b)) echo "NOT "; echo "numeric"; echo "$c "; if (!is_numeric($c))

[PHP-WIN] Re: How to check if a *string* has only numbers...

2004-11-19 Thread user
Hi, Have you tried regular expressions ? try them, they might do the trick Rui Francisco Rafael Soares wrote: Hello people!!! I would like to check if a string contains only numbers, I really can’t realize how to do it. I tried is_int(), but it don’t work because the variable is a string (I u