note 29793 added to function.sizeof
| From: | jt at tsw dot org dot uk | Date: | Tue, 25 Feb 2003 12:26:51 +0000 |
| Subject: | note 29793 added to function.sizeof | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44496@lists.php.net to get a copy of this message | ||
Ok, blatently obvious BUT it might stump some people (it had me scratching my head, before kicking
myself over the stupidity...)
$foo = "lalalallalaa this is some text lalala";
echo sizeof($foo);
this will print a 1 .... sizeof does not do string lengths - use strlen:
$foo = "lalalallalaa this is some text lalala";
echo strlen($foo);
--
http://www.php.net/manual/en/function.sizeof.php
http://master.php.net/manage/user-notes.php?action=edit+29793
http://master.php.net/manage/user-notes.php?action=delete+29793
http://master.php.net/manage/user-notes.php?action=reject+29793