{"id":1435,"date":"2012-11-04T22:22:20","date_gmt":"2012-11-04T22:22:20","guid":{"rendered":"https:\/\/theextremewebdesigns.com\/blog\/?p=1435"},"modified":"2012-11-04T22:22:20","modified_gmt":"2012-11-04T22:22:20","slug":"php-convert-html-entities-back-to-their-applicable-characters","status":"publish","type":"post","link":"https:\/\/theextremewebdesigns.com\/blog\/php-convert-html-entities-back-to-their-applicable-characters\/","title":{"rendered":"PHP Convert HTML Entities back to their applicable characters"},"content":{"rendered":"<p>If you have escaped raw html and want to <em><strong>convert the HTML Entities back to their applicable characters using PHP<\/strong><\/em>, then this can be done very easily using just 1 line of code. In this article, I am going to share a very simple way to do it. So read on to find out how to do this.<!--more--><\/p>\n<h2>PHP Convert HTML Entities back to their applicable characters<\/h2>\n<p>Ok, if you don&#8217;t have a clue as to what escaped html would look like, following is an example:<\/p>\n<p><strong>Escaped HTML:<\/strong><\/p>\n<pre class=\"lang:php decode:true\">&amp;lt;?php echo \"Hi there!\"; ?&amp;gt;<\/pre>\n<p><strong>What we need:<\/strong><\/p>\n<pre class=\"lang:php decode:true\">&lt;?php echo \"Hi there!\"; ?&gt;<\/pre>\n<p><strong>Solution:<\/strong><\/p>\n<pre class=\"lang:php decode:true\">$str = '&amp;lt;?php echo \"Hi there!\"; ?&amp;gt;';\n\n$new_str = html_entity_decode($str);\n\necho $new_str;<\/pre>\n<h5>That&#8217;s it!<\/h5>\n<p>Do you know of any other ways to <strong>Convert HTML Entities back to their applicable characters in PHP<\/strong>? Feel free to suggest by commenting below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have escaped raw html and want to convert the HTML Entities back to their applicable characters using PHP, then this can be done very easily using just 1 line of code. In this article, I am going to share a very simple way to do it. So read on to find out how [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":141,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10,13],"tags":[33],"class_list":["post-1435","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php-tips-and-tricks","category-tips-and-tricks","tag-php-tips"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paBnQX-n9","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/1435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/comments?post=1435"}],"version-history":[{"count":0,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/1435\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/media?parent=1435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/categories?post=1435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/tags?post=1435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}