Reputation: 19242
I'm doing Dom selection with table tr td
but this gives me all td in the table. How can I choose only the second td in every row?
Upvotes: 0
Views: 449
Reputation: 164811
Assuming you're using the DOM library, try this XPath expression
// $doc is your DOM Document
$xpath = new DOMXpath($doc);
$cells = $xpath->query('//table/tr/td[2]');
Upvotes: 1