note 29802 rejected from function.is-int by rioter

From: Date: Tue, 25 Feb 2003 23:49:19 +0000
Subject: note 29802 rejected from function.is-int by rioter
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-44524@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.

« previous php.notes (#44524) next »