On 03/14/2013 11:50 AM, Samuel Lopes Grigolato wrote:
Something like "if (is_numeric($var)&&  $var == floor($var))" will do the
trick. I don't know if there's a better (more elegant) way.

On Thu, Mar 14, 2013 at 3:09 PM, Matijn Woudt<tijn...@gmail.com>  wrote:

On Thu, Mar 14, 2013 at 7:02 PM, georg<georg.chamb...@telia.com>  wrote:


I have tried to find a way to check if a character string is possible to
test whether it is convertible to an intger !

any suggestion ?

BR georg

You could use is_numeric for that, though it also accepts floats.

- Matijn

for that type of test I have always used this:

if ( $val == (int)$val ) {


Jim Lucas


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

Reply via email to