|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-06-01 08:45 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 21 06:00:01 2025 UTC |
Description: ------------ php.ini: ... mbstring.func_overload=6; mbstring.internal_encoding=UTF-8; mbstring.http_input = auto; mbstring.detect_order = ISO-8859-1,UTF-8; mbstring.encoding_translation = On; ... The function str_split does not work correctly with characters >1 byte. in my testscript the katakana character is submitted by a web form to php. in order to make the reproduce code as easy as possible i just copied the katakana symbol into the code. Reproduce code: --------------- $foo = '入'; print "StrLength: ".strlen($foo)."\n"; $I = str_split($foo); print "array size: ".sizeof($I)."\n"; print_r($I); Expected result: ---------------- StrLength: 1 array size: 1 Array ( [0] => 入; ) Actual result: -------------- StrLength: 1 array size: 3 Array ( [0] => � [1] => � [2] => � )