note 68839 added to function.mb-strlen
| From: | filatei at gmail dot com | Date: | Sat, 12 Aug 2006 17:48:43 +0000 |
| Subject: | note 68839 added to function.mb-strlen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-115835@lists.php.net to get a copy of this message | ||
I have been working with some funny html characters lately and due to the nightmare in manipulating
them between mysql and php, I got the database column set to utf8, then store characters with html
enity "ọ" as á» in the database and set the encoding on php as
"utf8".
This is where mb_strlen became more useful than strlen. While strlen('á»') gives
result as 3, mb_strlen('á»','UTF-8') gives 1 as expected.
But left(column1,1) in mysql still gives wrong char for a multibyte string. In the example above, I
had to do left(column1,3) to get the correct string from mysql. I am now about to investigate
multibyte manipulation in mysql.
----
Server IP: 66.207.199.35
Probable Submitter: 24.89.226.75
----
X-Spam-Status: Yes, hits=7.4 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HEAD_ILLEGAL_CHARS autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.mb-strlen.php
Edit -- https://master.php.net/note/edit/68839
Del: integrated -- https://master.php.net/note/delete/68839/integrated
Del: useless -- https://master.php.net/note/delete/68839/useless
Del: bad code -- https://master.php.net/note/delete/68839/bad+code
Del: spam -- https://master.php.net/note/delete/68839/spam
Del: non-english -- https://master.php.net/note/delete/68839/non-english
Del: in docs -- https://master.php.net/note/delete/68839/in+docs
Del: other reasons-- https://master.php.net/note/delete/68839
Reject -- https://master.php.net/note/reject/68839
Search -- https://master.php.net/manage/user-notes.php