{"id":450,"date":"2009-05-15T17:03:43","date_gmt":"2009-05-15T15:03:43","guid":{"rendered":"https:\/\/devpath.pro\/?p=450"},"modified":"2009-05-15T17:03:43","modified_gmt":"2009-05-15T15:03:43","slug":"ita-rimuovere-le-entita-html-unhtmlentities","status":"publish","type":"post","link":"https:\/\/fabiocicerchia.it\/web\/ita-rimuovere-le-entita-html-unhtmlentities","title":{"rendered":"[ITA] Rimuovere le entit\u00e0 HTML (unhtmlentities)"},"content":{"rendered":"\n
Ecco un modo veloce per rimuovere tutte le entit\u00e0 html da una stringa:<\/p>\n\n\n\n
function unhtmlentities($string) {
$string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec(\"\\\\1\"))', $string);
$string = preg_replace('~&#([0-9]+);~e', 'chr(\"\\\\1\")', $string);
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}<\/pre>\n\n\n\nquesta funzione sostituisce sia le entit\u00e0 numeriche che quelle testuali.<\/p>\n","protected":false},"excerpt":{"rendered":"
Ecco un modo veloce per rimuovere tutte le entit\u00e0 html da una stringa: function unhtmlentities($string) { $string = preg_replace(‘~&#x([0-9a-f]+);~ei’, ‘chr(hexdec(“\\\\1”))’, $string); $string = preg_replace(‘~&#([0-9]+);~e’, ‘chr(“\\\\1”)’, $string); $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl);} questa funzione sostituisce sia le entit\u00e0 numeriche che quelle testuali.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","footnotes":""},"categories":[14],"tags":[100,101,11,20,102],"aioseo_notices":[],"author_meta":{"display_name":"fabio","author_link":"https:\/\/fabiocicerchia.it\/author\/fabio"},"featured_img":null,"coauthors":[],"tax_additional":{"categories":{"linked":["Web<\/a>"],"unlinked":["Web<\/span>"]},"tags":{"linked":["entities<\/a>","html<\/a>","italian<\/a>","php<\/a>","snippet<\/a>"],"unlinked":["entities<\/span>","html<\/span>","italian<\/span>","php<\/span>","snippet<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 15 years ago","modified":"Updated 15 years ago"},"absolute_dates":{"created":"Posted on May 15, 2009","modified":"Updated on May 15, 2009"},"absolute_dates_time":{"created":"Posted on May 15, 2009 5:03 pm","modified":"Updated on May 15, 2009 5:03 pm"},"featured_img_caption":"","series_order":"","_links":{"self":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/posts\/450"}],"collection":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/comments?post=450"}],"version-history":[{"count":0,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/posts\/450\/revisions"}],"wp:attachment":[{"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/media?parent=450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/categories?post=450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fabiocicerchia.it\/wp-json\/wp\/v2\/tags?post=450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}