note 22521 deleted from function.is-int by didou

From: Date: Sun, 18 May 2003 10:15:38 +0000
Subject: note 22521 deleted from function.is-int by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-48498@lists.php.net to get a copy of this message
Note Submitter: chensc@execcorner.com ---- >is_int() does not work when passing strings. >This one does: >function str_is_int($str) { > $var=intval($str); > return ($str==$var); >} Not quite, change the return line to: return ("$str" == "$var");

« previous php.notes (#48498) next »