note 21234 modified in function.is-int by sander

From: Date: Sat, 04 May 2002 09:07:24 +0000
Subject: note 21234 modified in function.is-int by sander
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-30162@lists.php.net to get a copy of this message
[Ed. note: is_int() checks whether the type of the variable is an int, not the contents. If you want to check the contents, you can use is_numeric(). ] is_int() does not work when passing strings. This one does: function str_is_int($str) { $var=intval($str); return ($str==$var); } --was-- is_int() does not work when passing strings. This one does: function str_is_int($str) { $var=intval($str); return ($str==$var); } http://www.php.net/manual/en/function.is-int.php

« previous php.notes (#30162) next »