I cannot figure out how to stop the DOMDocument from distorting these characters.
<?php $doc = new DOMDocument(); $doc->substituteEntities = false; $doc->loadHTML('<p>¯\(°_o)/¯</p>'); print_r($doc->saveHTML()); ?>
Expected Result: ¯ (° _o) / ¯
Actual Output: & ACIRC; & MACR; (& ACIRC; & deg; _o) / & ACIRC; & MACR;
http://codepad.org/W83eHSsT
dom php
anonymous
source share