weird white space characters - utf8 PHP

后端 未结 1 666
夕颜
夕颜 2021-01-14 06:24

I have a weird whitespaces in string, white spaces are not white spaces. I have a problem with converting them with regex and str_replace i.e.

echo str_repla         


        
相关标签:
1条回答
  • 2021-01-14 07:03

    I think I got it, from PHP site:

    You might wonder why

    trim(html_entity_decode(' '));    
    

    doesn't reduce the string to an empty string, that's because the ' ' entity is not ASCII code 32 (which is stripped by trim()) but ASCII code 160 (0xa0) in the default ISO 8859-1 characterset.

    0 讨论(0)
提交回复
热议问题