php 将中文分割

2024-02-15 17:10:27

分隔符和要被切割的字符串有这样个中文字符串$str="你好,世界!你好,中国!",我司想以","为分隔符将其切割成数组,就这样写代码:

```php

$str="你好,世界!你好,中国!";

$array=explode(",",$str);

print_r($array);

```

`Array ( [] => 你好,世界! [] => 你好,中国! )`。

您能提供更多的上下文信息,我为您提供更具体的帮助。