what ASCII characters are these?

前端 未结 5 882
不思量自难忘°
不思量自难忘° 2021-01-06 19:02

I have two characters that I need to do a search and replace on in a php-string.

Somehow these are differ

5条回答
  •  长情又很酷
    2021-01-06 19:39

    That's what happens when someone sends you an email in outlook, so watch out, because you're totally missing the opening pair of those single quotes, and closing pair for the double quotes. But really, you need to be using html entity codes.

    Why? Because there's a hell of a lot more out there in the wilderness than those two codes you posted above, in-fact, you've only shown half the set of quotes (ie, you missed the closing single quote, and opening double quote). There's hundreds, you need to be encoding them in a better way than string replace.

    There's a couple ways to manage the translation from encoding to html entity.

    http://php.net/manual/en/function.htmlentities.php

    http://piology.org/entities.html

    http://konieczny.be/unicode.html

    There's more also, but they basically do the same thing.

提交回复
热议问题