title: get a complete table with php domdocument and print it
body: <p>I would like to get a complete html table having id = 'myid' from a given url using php domddocument and print it to our web page, How can i do this ?</p>
  
  <p>I am trying with below code to get table but i cant getting trs(table rows) and tds(table data) and other inner html.</p>
  
  <pre><code>$xml = new DOMDocument();
  
  @$xml-&gt;loadHTMLFile($url);
  foreach($xml-&gt;getElementById('myid') as $table)
  {
    // now how to get tr and td and other element ?
    // i am getting other element like :-
     $links = $table-&gt;getElementsByTagName('a');
     foreach($links as $innerAnchor)
    {
      //doing something with anchor tag...
     }
  
  }
  </code></pre>
  
  <p>Need help.</p>
  
  <p>I am new in php domddocument.</p>
  
  <p>Thanks a lot.</p>