title: How to stop PHP Domdocument::SaveXML from inserting "CDATA"?
body: <p>I'm using PHP to get all the "script" tags from web pages, and then appending text after the &lt;/script&gt; that is not always valid html. Because it's not always valid markup I can't just use appendchild/replacechild to add that information, unless I'm misunderstanding how replacechild works.</p>
  
  <p>Anyway, when I do</p>
  
  <pre><code>$script_tags = $doc-&gt;getElementsByTagName('script');
  $l = $script_tags-&gt;length;
  for ($i = $l - 1; $i &gt; -1; $i--)
  $script_tags_string = $doc-&gt;saveXML($script_tags-&gt;item($i));
  </code></pre>
  
  <p>This puts "&lt;![CDATA[" and "]]&gt;" around the contents of the script tag. How can I disable this? Please don't tell me to just delete it afterwards, that's what I'm going to do if I can't find a solution for this.</p>