For tidy HTML codes, one of the parsing methods can be the DOM. The DOM divides your HTML code into objects, and then allows you to call the desired object and its values โโ/ tag name, etc.
The official PHP HTML DOM parsing documentation is available at http://php.net/manual/en/book.dom.php
To find the values โโof the second coloumn for a given table after the DOM is executed, it can be done:
<?php $data = file_get_contents('http://mytemporalbucket.s3.amazonaws.com/code.txt'); $dom = new domDocument; @$dom->loadHTML($data); $dom->preserveWhiteSpace = false; $tables = $dom->getElementsByTagName('table'); $rows = $tables->item(1)->getElementsByTagName('tr'); foreach ($rows as $row) { $cols = $row->getElementsByTagName('td'); echo $cols[2]; } ?>
Link: Configure the code provided in How to parse this table and extract data from it? to fit this issue. p>
codersofthedark
source share