note 72596 added to function.strlen
| From: | egmont at uhulinux dot hu | Date: | Thu, 25 Jan 2007 13:18:49 +0000 |
| Subject: | note 72596 added to function.strlen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122184@lists.php.net to get a copy of this message | ||
Paolo, are you sure about strlen() counting characters? Could you please show me an example?
For me it seems that strlen() always count bytes, no matter what the current locale or
mb_internal_encoding is, just as its C counterpart does. If you want to count characters then you
have to set the encoding with mb_internal_encoding() and then use mb_strlen().
----
Server IP: 195.56.193.13
Probable Submitter: 195.56.209.132
----
Manual Page -- http://www.php.net/manual/en/function.strlen.php
Edit -- https://master.php.net/note/edit/72596
Del: integrated -- https://master.php.net/note/delete/72596/integrated
Del: useless -- https://master.php.net/note/delete/72596/useless
Del: bad code -- https://master.php.net/note/delete/72596/bad+code
Del: spam -- https://master.php.net/note/delete/72596/spam
Del: non-english -- https://master.php.net/note/delete/72596/non-english
Del: in docs -- https://master.php.net/note/delete/72596/in+docs
Del: other reasons-- https://master.php.net/note/delete/72596
Reject -- https://master.php.net/note/reject/72596
Search -- https://master.php.net/manage/user-notes.php