note 52850 added to function.is-numeric

From: Date: Sat, 14 May 2005 22:01:25 +0000
Subject: note 52850 added to function.is-numeric
Groups: php.notes 
Request: Send a blank email to php-notes+get-89437@lists.php.net to get a copy of this message
As mentioned above use the ctype character type functions to determine a strings type as ctype is faster. ctype_digit has far better benchmarks than is_numeric. // Example: $num = '888'; if(ctype_digit($num) === TRUE): echo 'The string variable $num contains the decimal value '.$num; endif; ---- Manual Page -- http://www.php.net/manual/en/function.is-numeric.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52850 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52850&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52850&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52850&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52850&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52850&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52850&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#89437) next »