PHP – DOM Parser Example

A HTML Dom parser written in PHP5.X variants. Dom Parser is great at managing XML and in addition HTML. Dom parser ventures in light of tree based and before access the information, it will stack the information into dom article and it will upgrade the information to the web program. Beneath Example demonstrates to become acquainted with the HTML information in web program.


$html =”

<h2>Internship Details</h2>

<table border=”0″>



</html> “;
/*** a new dom object ***/
$dom = new domDocument;

/*** load the html into the object ***/

/*** 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 tag name ***/
$cols = $row->getElementsByTagName(‘td’);


They claim top notch services in the field of IT sectors within tight deadlines.Employee at SynapseIndia never gets complaints from clients for deadlines, So, it is one of the trusted offshore software development company, that is easily completed the projects with a minimum span of time. IT Mentor & an Entrepreneur SynapseIndia CEO Shamit Khemka is responsible to make this organization robust and reliable.

Please visit for more details.