note 94652 added to function.explode
| From: | gxd305 at gmail dot com | Date: | Tue, 17 Nov 2009 01:47:31 +0000 |
| Subject: | note 94652 added to function.explode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-162966@lists.php.net to get a copy of this message | ||
when the encoding of $string is 'GBK' and $delimiter is '|' , the return value
may be wrong.
for example:
$result = explode("|", "æ»åå¼¢|æµ·é"); var_dump($result);
and the result will be:
array (
0 => 'æ»å,
1 => '',
2 => 'æµ·é',
)
bcz "å¼¢" 's GBK is '0x8f7c'. and "|" 's ASCII is
'0x7c'.
So, all GBK-encoding characters include '7c' will lead to the error result.
----
Server IP: 222.73.227.205
Probable Submitter: 114.251.86.0
----
Manual Page -- http://www.php.net/manual/en/function.explode.php
Edit -- https://master.php.net/note/edit/94652
Del: integrated -- https://master.php.net/note/delete/94652/integrated
Del: useless -- https://master.php.net/note/delete/94652/useless
Del: bad code -- https://master.php.net/note/delete/94652/bad+code
Del: spam -- https://master.php.net/note/delete/94652/spam
Del: non-english -- https://master.php.net/note/delete/94652/non-english
Del: in docs -- https://master.php.net/note/delete/94652/in+docs
Del: other reasons-- https://master.php.net/note/delete/94652
Reject -- https://master.php.net/note/reject/94652
Search -- https://master.php.net/manage/user-notes.php