Convert PHP entities like – or š to their applicable characters

后端 未结 3 1365
后悔当初
后悔当初 2021-02-07 21:39

is there a way how to convert HTML entities to their applicable characters. Something similar to html_entity_decode()?
I\'m trying to make ordinary text wit

3条回答
  •  醉酒成梦
    2021-02-07 21:53

    I originally wrote the code that's pasted into Pekka's answer - it's nearly completely unnecessary except in specific cases (mostly for removing non-existent entities, which html_entity_decode() doesn't touch, or for converting to numeric entities if you're making XML that isn't UTF-8 encoded).

    TinyMCE has an option to return raw (not HTML-encoded) output, so that should be your first point of call. Look at this entry in the TinyMCE manual for more info on that.

提交回复
热议问题