note 109701 deleted from function.is-int by danbrown

From: Date: Fri, 31 Aug 2012 16:37:05 +0000
Subject: note 109701 deleted from function.is-int by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-190388@lists.php.net to get a copy of this message
Note Submitter: Phatteus ---- This approach mentioned below: ( is_int($value) || ctype_digit($value) only works for positive values and will return false for negative numbers in a string. A safer approach may be what was suggested in the anonymous post from 2012-05-25: strval(intval($var)) == strval($var))

« previous php.notes (#190388) next »