note 94652 deleted from function.explode by sobak
| From: | sobak@php.net | Date: | Sat, 10 Dec 2016 23:19:10 +0000 |
| Subject: | note 94652 deleted from function.explode by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208465@lists.php.net to get a copy of this message | ||
Note Submitter: gxd305 at gmail dot com
----
when the encoding of $string is 'GBK' and $delimiter is '|' , the return value
may be wrong.
for example:
<?php
$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.