title: Remove HTML Tag using DOMDocument
body: <p>I'd like to remove <code>&lt;font&gt;</code> tags from my html and am trying to use <code>replaceChild</code> to do so, but it doesn't seem to work properly.  Can anyone catch what might be wrong?</p>
  
  <pre><code>$html = '&lt;html&gt;&lt;body&gt;&lt;br&gt;&lt;font class="heading2"&gt;Limited Size and Resources&lt;/font&gt;&lt;p&gt;&lt;br&gt;&lt;strong&gt;Q: When can a member use the limited size and resources exception?&lt;/strong&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;';
  
  $dom = new DOMDocument();
  $dom-&gt;loadHTML($html);
  $font_tags = $dom-&gt;GetElementsByTagName('font');
  
  foreach($font_tags as $font_tag) {
    foreach($font_tag as $child) {
      $child-&gt;replaceChild($child-&gt;nodeValue, $font_tag);
    }
  }
  
  echo $dom-&gt;saveHTML();
  </code></pre>
  
  <p>From what I understand, <code>$font_tags</code> is a <code>DOMNodeList</code>, so I need to iterate through it twice in order to use the <code>DOMNode::replaceChild</code> function.  I then want to replace the current value with just the content inside of the tags.  However, when I output the $html nothing changes.  Any ideas what could be wrong?</p>
  
  <p><a href="http://sandbox.onlinephpfunctions.com/code/18513fea5cb760721e53dfe92d87b8cf24f01d69" rel="nofollow">Here</a> is a PHP Sandbox to test the code.</p>