1
The split() PHP function allows the delimiter to be a regular expression. Unfortunately it's deprecated and will be removed in PHP7!
split() PHP函數允許分隔符是正則表達式。不幸的是,它已被棄用,將在PHP7中刪除!
The preg_split() function should be OK, and it returns an array:
preg_split()函數應該是OK,並返回一個數組:
$results = preg_split('/[;,]/', $string);
There are a few extra optional parameters which may be useful to you.
有一些額外的可選參數可能對您有用。
Is the first delimiter character in your edited example actually a 2 byte Unicode character?
在您編輯的示例中,第一個分隔符實際上是一個2字節的Unicode字符嗎?
Perhaps the preg_slit() function is treating the delimiter as three characters and splitting between the characters of the unicode (Chinese?) 'character'
也許preg_cut()函數將分隔符視為三個字符,並在unicode字符(中文?)之間進行分割。“性格”