开发者

PHp + space in linux

开发者 https://www.devze.com 2023-03-06 00:40 出处:网络
In my below code I am replacing . with a non-breaking space using   $orginal_startString = str_replace(\'.\',\' \',$startString);

In my below code I am replacing . with a non-breaking space using  

$orginal_startString = str_replace('.',' ',$startString);

This works fine in windows and save in databas开发者_运维知识库e but in linux it's not woking properl it's replacing . with special character Â.


If you want space as text not HTML, Use the hex equivalent 0x20.

$orginal_startString = str_replace('.',chr(0x20),$startString);

And check this HTML encoding issues - "Â" character showing up instead of " "

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号