Weird dash character in PHP

前端 未结 4 1922
忘了有多久
忘了有多久 2020-12-19 07:23

I have a weird dash in my text, which isn\'t being detected in a str_replace.

Here is an example:

Sun: 10:00 – 3:00pm

I don

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-19 07:39

    En - Dash we're used to seeing
    Em Dash that we're supposed to use most of the time where use "-".
    Basically, it's a grammar thing.

    Read up on Wikipedia: http://en.wikipedia.org/wiki/Dash

    On a mac (with US Keyboard Layout) I get it hitting Alt+- , same as you get _ with shift+_

    You don't need any special treatement to it as it were some chinese symbol. It is a valid character. Treat it as such: str_replace('–', 'em dash');.

提交回复
热议问题