explode() on Japanese string

后端 未结 5 1266
情话喂你
情话喂你 2021-01-21 04:41

I have to use the explode() function on Japanese text but it doesn\'t work.

Here is an example of what I have

$string = \'私 は イタリア 人 です\';
$string = expl         


        
5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-21 05:30

    convert your string first using iconv() and then use it on explode. Convert to utf8

    $string = explode(" ", iconv('', 'utf-8', $string));
    

提交回复
热议问题