{"id":217837,"date":"2023-12-23T01:05:21","date_gmt":"2023-12-22T17:05:21","guid":{"rendered":"https:\/\/www.idc.net\/help\/217837\/"},"modified":"2023-12-23T01:05:21","modified_gmt":"2023-12-22T17:05:21","slug":"php%e5%87%bd%e6%95%b0%ef%bc%9ahtml_entity_decode","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/217837\/","title":{"rendered":"PHP\u51fd\u6570\uff1ahtml_entity_decode"},"content":{"rendered":"<h1 id=\"php%e5%87%bd%e6%95%b0%ef%bc%9ahtml_entity_decode-EagimAGhrl\">PHP\u51fd\u6570\uff1ahtml_entity_decode<\/h1>\n<p>\u5728PHP\u4e2d\uff0c\u6709\u8bb8\u591a\u5185\u7f6e\u51fd\u6570\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5904\u7406\u5b57\u7b26\u4e32\u3002\u5176\u4e2d\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u51fd\u6570\u662fhtml_entity_decode\u3002\u8fd9\u4e2a\u51fd\u6570\u7528\u4e8e\u5c06HTML\u5b9e\u4f53\u8f6c\u6362\u56de\u5b83\u4eec\u7684\u539f\u59cb\u5b57\u7b26\u3002<\/p>\n<h2 id=\"html_entity_decode%e5%87%bd%e6%95%b0%e7%9a%84%e8%af%ad%e6%b3%95-EagimAGhrl\">html_entity_decode\u51fd\u6570\u7684\u8bed\u6cd5<\/h2>\n<p>html_entity_decode\u51fd\u6570\u7684\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre><code>string html_entity_decode ( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = ini_get(&quot;default_charset&quot;) ]] )\n<\/code><\/pre>\n<p>\u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li><code>string<\/code>\uff1a\u8981\u89e3\u7801\u7684\u5b57\u7b26\u4e32\u3002<\/li>\n<li><code>flags<\/code>\uff1a\u53ef\u9009\u53c2\u6570\uff0c\u7528\u4e8e\u6307\u5b9a\u89e3\u7801\u65f6\u7684\u884c\u4e3a\u3002\u9ed8\u8ba4\u503c\u4e3a<code>ENT_COMPAT | ENT_HTML401<\/code>\u3002<\/li>\n<li><code>encoding<\/code>\uff1a\u53ef\u9009\u53c2\u6570\uff0c\u7528\u4e8e\u6307\u5b9a\u89e3\u7801\u540e\u7684\u5b57\u7b26\u7f16\u7801\u3002\u9ed8\u8ba4\u503c\u4e3a<code>ini_get(\"default_charset\")<\/code>\u3002<\/li>\n<\/ul>\n<h2 id=\"html_entity_decode%e5%87%bd%e6%95%b0%e7%9a%84%e7%94%a8%e6%b3%95-EagimAGhrl\">html_entity_decode\u51fd\u6570\u7684\u7528\u6cd5<\/h2>\n<p>\u4e0b\u9762\u662fhtml_entity_decode\u51fd\u6570\u7684\u4e00\u4e9b\u793a\u4f8b\u7528\u6cd5\uff1a<\/p>\n<h3 id=\"%e7%a4%ba%e4%be%8b1%ef%bc%9a%e5%9f%ba%e6%9c%ac%e7%94%a8%e6%b3%95-EagimAGhrl\">\u793a\u4f8b1\uff1a\u57fa\u672c\u7528\u6cd5<\/h3>\n<pre><code>&lt;?php\n  $str = &quot;This is an example of &amp;quot;html_entity_decode&amp;quot; function.&quot;;\n  $decoded_str = html_entity_decode($str);\n  echo $decoded_str;\n?&gt;\n<\/code><\/pre>\n<p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<pre><code>This is an example of \"html_entity_decode\" function.\n<\/code><\/pre>\n<h3 id=\"%e7%a4%ba%e4%be%8b2%ef%bc%9a%e8%a7%a3%e7%a0%81%e7%89%b9%e6%ae%8a%e5%ad%97%e7%ac%a6-EagimAGhrl\">\u793a\u4f8b2\uff1a\u89e3\u7801\u7279\u6b8a\u5b57\u7b26<\/h3>\n<pre><code>&lt;?php\n  $str = &quot;This is an example of &#8364; symbol.&quot;;\n  $decoded_str = html_entity_decode($str);\n  echo $decoded_str;\n?&gt;\n<\/code><\/pre>\n<p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<pre><code>This is an example of \u20ac symbol.\n<\/code><\/pre>\n<h3 id=\"%e7%a4%ba%e4%be%8b3%ef%bc%9a%e8%a7%a3%e7%a0%81%e5%a4%9a%e4%b8%aa%e5%ae%9e%e4%bd%93-EagimAGhrl\">\u793a\u4f8b3\uff1a\u89e3\u7801\u591a\u4e2a\u5b9e\u4f53<\/h3>\n<pre><code>&lt;?php\n  $str = &quot;This is an example of &amp;quot;html_entity_decode&amp;quot; function. It also decodes &#8364; symbol.&quot;;\n  $decoded_str = html_entity_decode($str);\n  echo $decoded_str;\n?&gt;\n<\/code><\/pre>\n<p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<pre><code>This is an example of \"html_entity_decode\" function. It also decodes \u20ac symbol.\n<\/code><\/pre>\n<h2 id=\"%e6%80%bb%e7%bb%93-EagimAGhrl\">\u603b\u7ed3<\/h2>\n<p>html_entity_decode\u51fd\u6570\u662f\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684PHP\u51fd\u6570\uff0c\u7528\u4e8e\u5c06HTML\u5b9e\u4f53\u8f6c\u6362\u56de\u5b83\u4eec\u7684\u539f\u59cb\u5b57\u7b26\u3002\u5b83\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5904\u7406\u5305\u542b\u7279\u6b8a\u5b57\u7b26\u7684\u5b57\u7b26\u4e32\u3002\u5982\u679c\u4f60\u5728\u5f00\u53d1PHP\u5e94\u7528\u7a0b\u5e8f\u65f6\u9700\u8981\u5904\u7406HTML\u5b9e\u4f53\uff0c\u90a3\u4e48html_entity_decode\u51fd\u6570\u5c06\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u9009\u62e9\u3002<\/p>\n<h2 id=\"%e9%a6%99%e6%b8%af%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%a6%96%e9%80%89%e5%90%8e%e6%b5%aa%e4%ba%91-EagimAGhrl\">\u9999\u6e2f\u670d\u52a1\u5668\u9996\u9009\u540e\u6d6a\u4e91<\/h2>\n<p>\u5982\u679c\u4f60\u6b63\u5728\u5bfb\u627e\u53ef\u9760\u7684\u9999\u6e2f\u670d\u52a1\u5668\u63d0\u4f9b\u5546\uff0c\u540e\u6d6a\u4e91\u662f\u4f60\u7684\u9996\u9009\u3002\u540e\u6d6a\u4e91\u63d0\u4f9b\u9ad8\u6027\u80fd\u7684\u9999\u6e2f\u670d\u52a1\u5668\uff0c\u53ef\u4ee5\u6ee1\u8db3\u5404\u79cd\u9700\u6c42\u3002\u65e0\u8bba\u4f60\u662f\u4e2a\u4eba\u7528\u6237\u8fd8\u662f\u4f01\u4e1a\u7528\u6237\uff0c\u540e\u6d6a\u4e91\u90fd\u80fd\u4e3a\u4f60\u63d0\u4f9b\u7a33\u5b9a\u53ef\u9760\u7684\u670d\u52a1\u5668\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p>\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u540e\u6d6a\u4e91\u7684\u9999\u6e2f\u670d\u52a1\u5668\uff0c\u8bf7\u8bbf\u95ee<a href=\"https:\/\/idc.net\">https:\/\/idc.net<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u51fd\u6570\uff1ahtml_entity_decode \u5728PHP\u4e2d\uff0c\u6709\u8bb8\u591a\u5185\u7f6e\u51fd\u6570\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u5904\u7406\u5b57\u7b26\u4e32\u3002\u5176\u4e2d\u4e00\u4e2a\u975e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[197851],"tags":[],"class_list":["post-217837","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/217837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=217837"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/217837\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=217837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=217837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=217837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}