Tag: html tag
-
How to read html table tag in php?
<?php // new dom object $dom = new DOMDocument(); //load the html $html = $dom->loadHTMLFile(“test.html”); //discard white space $dom->preserveWhiteSpace = false; //the table by its tag name $tables = $dom->getElementsByTagName(‘table’); //get all rows from the table $rows = $tables->item(0)->getElementsByTagName(‘tr’); // loop over the table rows foreach ($rows as $row) { // get each column by…
