fork download
  1. <?php
  2.  
  3. header("Content-Type: text/plain");
  4.  
  5. $doc = new DOMDocument();
  6. $el = $doc->createElement('img', 'test &copy; test');
  7. $doc->appendChild($el);
  8.  
  9. $html = $doc->saveHtml();
  10. echo $html;
  11.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
<img>