note 109910 added to function.ctype-digit

From: Date: Sun, 02 Sep 2012 16:42:17 +0000
Subject: note 109910 added to function.ctype-digit
Groups: php.notes 
Request: Send a blank email to php-notes+get-190426@lists.php.net to get a copy of this message
Hi Tim, since PHP 5.2 you can use the filter_var() function <?php //only digits (0-9) are allowed, integer and string if (false !== filter_var($iValue, FILTER_VALIDATE_INT)) { //return $iValue if characters are only digits //or boolean FALSE if not } ---- Server IP: 69.147.83.197 Probable Submitter: 91.65.248.109 ---- Manual Page -- http://www.php.net/manual/en/function.ctype-digit.php Edit -- https://master.php.net/note/edit/109910 Del: integrated -- https://master.php.net/note/delete/109910/integrated Del: useless -- https://master.php.net/note/delete/109910/useless Del: bad code -- https://master.php.net/note/delete/109910/bad+code Del: spam -- https://master.php.net/note/delete/109910/spam Del: non-english -- https://master.php.net/note/delete/109910/non-english Del: in docs -- https://master.php.net/note/delete/109910/in+docs Del: other reasons-- https://master.php.net/note/delete/109910 Reject -- https://master.php.net/note/reject/109910 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#190426) next »