Jump to content

Checking if var is a number


ShaolinF

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.