note 104656 deleted from function.is-int by danbrown
| From: | danbrown@php.net | Date: | Wed, 29 Jun 2011 15:38:17 +0000 |
| Subject: | note 104656 deleted from function.is-int by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-181057@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
to Roberto Rama
http://fr.php.net/manual/fr/function.is-int.php#92370
Be careful:
isint('') returns true;
In your regexp, I just replace * by +
<?php
function isint( $mixed )
{
return ( preg_match( '/^\d+$/' , $mixed) == 1 );
}
?>