我很好地回应日语字符,但是当我尝试将字符串中的部分字符串消除时,它只是转向问号
注意:我将标题设置为utf-8
header('Content-Type: text/html; charset=utf-8');
Run Code Online (Sandbox Code Playgroud)
并做了元
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
$word = "????";
echo $word; //works just fine
echo substr($word,-1); //now it just echoes ?
//this one also failed
echo $word[0]; //echoes ?
Run Code Online (Sandbox Code Playgroud) 我有这样的文字:
some text \r\n \r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n some text \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n some text \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
我要更换多的每块\r\n只有一个<br/>
我尝试过使用str_replace('\\r\\n','<br/>',$text);但最终结果太多了<br/>
我需要最终输出如下:
some text <br/> some text <br/> some text <br/>