note 84071 added to function.is-int
| From: | mark at codedesigner dot nl | Date: | Thu, 26 Jun 2008 13:34:29 +0000 |
| Subject: | note 84071 added to function.is-int | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140834@lists.php.net to get a copy of this message | ||
updated version from Simon Neaves
<?php
function isInteger($input){
return preg_match('@^[-]?[0-9]+$@',$input) === 1;
}
?>
this function checks if the string:
- starts with a - sign (optional)
- ends with 1 or more numeric chars
----
Server IP: 213.249.64.162
Probable Submitter: 89.220.30.141
----
Manual Page -- http://www.php.net/manual/en/function.is-int.php
Edit -- https://master.php.net/note/edit/84071
Del: integrated -- https://master.php.net/note/delete/84071/integrated
Del: useless -- https://master.php.net/note/delete/84071/useless
Del: bad code -- https://master.php.net/note/delete/84071/bad+code
Del: spam -- https://master.php.net/note/delete/84071/spam
Del: non-english -- https://master.php.net/note/delete/84071/non-english
Del: in docs -- https://master.php.net/note/delete/84071/in+docs
Del: other reasons-- https://master.php.net/note/delete/84071
Reject -- https://master.php.net/note/reject/84071
Search -- https://master.php.net/manage/user-notes.php