note 33697 added to function.strlen
| From: | crouze_j``-at-''epitech dot net at rack1 dot php dot net | Date: | Fri, 04 Jul 2003 09:43:07 +0000 |
| Subject: | note 33697 added to function.strlen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51500@lists.php.net to get a copy of this message | ||
Be careful with the implicit int to string cast :
If
<?
$i = strlen(123456);
?>
strlen will return ``6'' and won't print any error,
123456 is casted to "123456"
This is not harmful, but could be, so, if needed ; protect yourself
with the is_numeric function.
----
Manual Page -- http://www.php.net/manual/en/function.strlen.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33697
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33697&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33697&report=yes