title: Replace <table> tag with dom in php
body: <p>I would like to trace al  tag and replace it with [table]. May i know how can i do it via html parser in php? </p>
  
  <p>For example:</p>
  
  <pre><code>hello there
  
  &lt;table&gt;&lt;tr&gt;&lt;td&gt;Some text&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  
  some text
  
  &lt;table&gt;&lt;tr&gt;&lt;td&gt;Some text&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  
  some text
  
  &lt;table&gt;&lt;tr&gt;&lt;td&gt;Some text&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  </code></pre>
  
  <p>to: </p>
  
  <pre><code>hello there
  
  [table]
  
  some text
  
  [table]
  
  some text
  
  [table]
  </code></pre>
  
  <p>may I know how can i do it with removechild to replace the table tag and replacechild? </p>
  
  <p>Thanks.</p>