HTML entities to normal strings in PHP

前端 未结 1 391
伪装坚强ぢ
伪装坚强ぢ 2021-01-24 02:25

I have a string with HTML entities in PHP. In html source i can see the html Entities but in the output my string is without html Entities.

like :

HTML source :<

相关标签:
1条回答
  • 2021-01-24 02:32

    See: http://php.net/manual/en/function.html-entity-decode.php

    The function html_entity_decode().

    This function decodes all the entities (including all numeric entities) that a) are necessarily valid for the chosen document type — i.e., for XML, this function does not decode named entities that might be defined in some DTD — and b) whose character or characters are in the coded character set associated with the chosen encoding and are permitted in the chosen document type. All other entities are left as is.

    0 讨论(0)
提交回复
热议问题