Last active
September 8, 2023 12:22
-
-
Save joshmfrankel/9e54ac68fd8682a817e2 to your computer and use it in GitHub Desktop.
Revisions
-
joshmfrankel revised this gist
Aug 21, 2014 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,13 @@ /** * Fix for broken html tags inside strings for php. * * By using passing the html through DOMDocument and converting the html * entities we are left with beautiful well formatted code. Huzzah! * * "Nothing is ever easy" -Zedd, Wizards First Rule * * @var DOMDocument */ $doc = new DOMDocument(); $doc->substituteEntities = false; $content = mb_convert_encoding($sValue, 'html-entities', 'utf-8'); -
joshmfrankel created this gist
Aug 21, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ $doc = new DOMDocument(); $doc->substituteEntities = false; $content = mb_convert_encoding($sValue, 'html-entities', 'utf-8'); $doc->loadHTML($content); $sValue = $doc->saveHTML();