PHP:解码Html实体

JMC*_*JMC 6 php html-entities

我想使用php html_entity_decode()解码html实体,但我的html实体似乎与函数不兼容.

Example Input String: html_entity_decode('<strong>');
Outputs: <strong>
Run Code Online (Sandbox Code Playgroud)

删除'amp;'解决问题并生成<strong>但我的文件'amp;'在每个html实体之前都有.大规模删除amp;可能会解决问题,但也对html非常具有破坏性.是否有可能amp;在所有实体之前将我的实体转换为额外的这种情况?

nic*_*ckb 15

它是双重编码的 - 运行html_entity_decode()两次字符串.

echo html_entity_decode( html_entity_decode('&amp;lt;strong&amp;gt;'));
Run Code Online (Sandbox Code Playgroud)

将输出:

<strong>
Run Code Online (Sandbox Code Playgroud)