note 109818 deleted from function.mb-substr by danbrown
| From: | danbrown@php.net | Date: | Fri, 31 Aug 2012 15:44:19 +0000 |
| Subject: | note 109818 deleted from function.mb-substr by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190323@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
@Â qeremy [atta] gmail [dotta] com
You have the wrong setting on mb_internal_encoding() (or didn't set it at all), that's
why it returns a wrong result :
<?php
mb_internal_encoding('UTF-8');
echo mb_substr('Büyük', 0, 3); // returns 'Büy' as expected
// OR
echo mb_substr('Büyük', 0, 3, 'UTF-8'); // returns 'Büy' as
expected
?>