Can't remove special characters with str_replace

后端 未结 8 666
北荒
北荒 2020-12-07 04:00

I have a very trivial problem with str_replace.

I have a string with the En Dash character ( - ) like this:

I want to remove - the dash
8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 04:51

    This was my solution for an invalid ndash:

    $string = str_replace(chr(hexdec('3f')), '-', $string);
    

提交回复
热议问题