note 95174 added to function.is-int
| From: | jerry at foufos dot gr | Date: | Wed, 16 Dec 2009 19:38:49 +0000 |
| Subject: | note 95174 added to function.is-int | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-164054@lists.php.net to get a copy of this message | ||
to Roberto Rama
the regular expression you suggest
<?php
preg_match( '/^\d*$/' , $mixed)
?>
will match to an empty string.
the PCRE *, matches 0 or more occurences.
you should change the preg to
<?php
preg_match( '/^\d+$/' , $mixed)
?>
the PCRE +, matches 1 or more occurences.
----
Server IP: 69.147.83.197
Probable Submitter: 92.119.50.163
----
Manual Page -- http://www.php.net/manual/en/function.is-int.php
Edit -- https://master.php.net/note/edit/95174
Del: integrated -- https://master.php.net/note/delete/95174/integrated
Del: useless -- https://master.php.net/note/delete/95174/useless
Del: bad code -- https://master.php.net/note/delete/95174/bad+code
Del: spam -- https://master.php.net/note/delete/95174/spam
Del: non-english -- https://master.php.net/note/delete/95174/non-english
Del: in docs -- https://master.php.net/note/delete/95174/in+docs
Del: other reasons-- https://master.php.net/note/delete/95174
Reject -- https://master.php.net/note/reject/95174
Search -- https://master.php.net/manage/user-notes.php