note 29802 added to function.is-int

From: Date: Tue, 25 Feb 2003 15:58:17 +0000
Subject: note 29802 added to function.is-int
Groups: php.notes 
Request: Send a blank email to php-notes+get-44507@lists.php.net to get a copy of this message
what's wrong with this? function str_is_int( $str ) { return ( (string)(int)$str == $str ); } this seems to allow for "+" and "-" signs, which is nice. You'll have to test whether $str is null seperately, though. -- http://www.php.net/manual/en/function.is-int.php http://master.php.net/manage/user-notes.php?action=edit+29802 http://master.php.net/manage/user-notes.php?action=delete+29802 http://master.php.net/manage/user-notes.php?action=reject+29802

« previous php.notes (#44507) next »