Removing non-numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



OK - easy one here, I know.  Having troubles removing anything that is not a
number from user input.  According to manual, [!] is supposed to mean set of
non-matching optional characters.  Tried

	$var = ereg_replace("[!0-9]","",$var);

and it removes the numbers, but so does

	$var = ereg_replace("[0-9]","",$var);

Any quick fix is greatly appreciated.  Would be great to not have to list
every possible character a user might enter between the [ and the ].
Doesn't matter how may times and how big of letters I use to say "enter
numbers only", people still enter non-numbers.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux