ShaolinF Posted November 22, 2009 Share Posted November 22, 2009 Hi Guys How can I check if a $_POST[] var is a number? Link to comment https://forums.phpfreaks.com/topic/182520-checking-if-var-is-a-number/ Share on other sites More sharing options...
Cardale Posted November 22, 2009 Share Posted November 22, 2009 is_numeric() Link to comment https://forums.phpfreaks.com/topic/182520-checking-if-var-is-a-number/#findComment-963347 Share on other sites More sharing options...
salathe Posted November 22, 2009 Share Posted November 22, 2009 You could use one of the Ctype[1] functions (ctype_digit), a Filter[2], is_numeric[3] to name a few different approaches. 1. http://php.net/ctype 2. http://php.net/filter and http://php.net/filter.filters.validate 3. http://php.net/is_numeric Link to comment https://forums.phpfreaks.com/topic/182520-checking-if-var-is-a-number/#findComment-963373 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.