The result of preg_split after executing Chinese is garbled
1. The result of preg_split after executing Chinese is garbled. as shown in Figure 1
$optionText = '多选一,多选二';
$optionInputs = preg_split('/[\r\n,,;;、]+/', $optionText);
2. Convert the string to UTF-8 before using preg_split(). u means Unicode (UTF-8) mode, avoiding Chinese character split errors.
$optionText = mb_convert_encoding('多选一,多选二', 'UTF-8', 'auto');
$optionInputs = preg_split('/[\r\n,,;;、]+/u', $optionText);
3, the split is correct, no more errors.
Array ( [0] => 多选一 [1] => 多选二 )
