Jump to content

Get contents of 3RD <td>


MySQL_Narb

Recommended Posts

As mentioned above DOMDocument and Xpath is the easiest way to go about it.

 

<?php
$dom = new DOMDocument(); 
$dom->loadHTML($content); // $content is the HTML code
$xpath = new DOMXPath($dom);
$value = $xpath->query("//path/to/tr/td[3]/text()")->item(0)->nodeValue; // change this path to suit
?>

Link to comment
https://forums.phpfreaks.com/topic/273805-get-contents-of-3rd/#findComment-1409063
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.