I want to make a bid system on a website. That means users can post their bid (natural number). I want to make sure users don\'t try to post characters, decimal numbers, etc
ctype_digit does what you want:
Checks if all of the characters in the provided string, text, are numerical. (Before PHP 5.1.0, this function returned TRUE when text was an empty string.)
Checks if all of the characters in the provided string, text, are numerical.
(Before PHP 5.1.0, this function returned TRUE when text was an empty string.)