I have a string with “\u00a0”, and I need to replace it with “” str_replace fails

后端 未结 8 1279
南笙
南笙 2020-12-17 09:45

I need to clean a string that comes (copy/pasted) from various Microsoft Office suite applications (Excel, Access, and Word), each with its own set of encoding.

I\'m

8条回答
  •  被撕碎了的回忆
    2020-12-17 09:55

    By combining ord() with substr() on my string containing \u00a0, I found the following curse to work:

    $text = str_replace( chr( 194 ) . chr( 160 ), ' ', $text );
    

提交回复
热议问题