Possible Duplicate:
Check if a variable is a natural number
Just came across where I need to sanitize an input and remove all non-digit characters with PHP. Thought of making a function myself, but just first wanted to check up on the possible built-in functions, so I won’t have to spend extra time reinventing the wheel.
You can use regular expression as below
OR