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 ?
I am trying with below code to get table but i cant getting trs(table rows) and tds(table data) and other inner html.
$xml = new DOMDocument();
@$xml->loadHTMLFile($url);
foreach($xml->getElementById('myid') as $table)
{
// now how to get tr and td and other element ?
// i am getting other element like :-
$links = $table->getElementsByTagName('a');
foreach($links as $innerAnchor)
{
//doing something with anchor tag...
}
}
Need help.
I am new in php domddocument.
Thanks a lot.