note 94652 deleted from function.explode by sobak

From: 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.

« previous php.notes (#208465) next »