@ 2013-11-01T14:06:08Z <?php
$html = <<<EOF
<table>
<tr>
<td>5CG </td>
<td>aass </td>
<td>sxs </td>
<td>sx </td>
<td>EK </td>
<td> </td>
<td>72 </td>
</tr>
<tr>
<td> </td>
<td>samplxs </td>
<td>xs </td>
<td> </td>
<td>xss </td>
<td>fkxsx aus</td>
<td>s </td>
</tr>
<tr>
<td> </td>
<td>5AH. </td>
<td>ds </td>
<td>d </td>
<td>sdf </td>
<td>sdfsdf aus</td>
<td> </td>
</tr>
<tr>
<td>6CG </td>
<td>3. </td>
<td>sfd </td>
<td> </td>
<td>scs </td>
<td>das aus</td>
<td>a </td>
</tr>
<tr>
<td>7DG </td>
<td>6. </td>
<td>s </td>
<td>s </td>
<td>sD </td>
<td>sdsa.</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>samplxs </td>
<td>xs </td>
<td> </td>
<td>xss </td>
<td>fkxsx aus</td>
<td>s </td>
</tr>
<tr>
<td>7DG, 7CG, 7CR </td>
<td>6. </td>
<td>NsdR </td>
<td>s </td>
<td>SP </td>
<td>fasdlt aus</td>
<td>s </td>
</tr>
<tr>
<td> </td>
<td>samplxs </td>
<td>xs </td>
<td> </td>
<td>xss </td>
<td>fkxsx aus</td>
<td>s </td>
</tr>
<tr>
<td> 9BR </td>
<td>6. </td>
<td>FEI </td>
<td>sa </td>
<td>DE </td>
<td>fasdad aus</td>
<td> </td>
</tr>
<tr>
<td>9AR, 9BR, 9CR</td>
<td>62. </td>
<td>BEH </td>
<td> </td>
<td>sd </td>
<td>fasda aus</td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>6. </td>
<td>MLR </td>
<td> </td>
<td>FdR </td>
<td>fsdfaus</td>
<td> </td>
</tr>
<tr>
<td>E10C </td>
<td>6. </td>
<td>sdf </td>
<td>d </td>
<td>d </td>
<td>fsdfs aus</td>
<td> </td>
</tr>
</table>
EOF;
$docH = new DOMDocument();
$docH->loadHTML($html);
$xpath = new DomXpath($docH);
$trs = $xpath->query('//td[contains(text(), "9BR")]/..');
foreach( $trs as $tr){
var_dump($tr->node());
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 Fatal error: Uncaught Error: Call to undefined method DOMElement::node() in /in/YgiN1:125
Stack trace:
#0 {main}
thrown in /in/YgiN1 on line 125
Process exited with code 255 . Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.1 , 5.1.3 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 Fatal error: Call to undefined method DOMElement::node() in /in/YgiN1 on line 125
Process exited with code 255 . Output for 5.1.2 Fatal error: Call to undefined method DOMElement::node() in /in/YgiN1 on line 126
Process exited with code 255 . Output for 4.3.2 - 4.3.11 , 4.4.0 - 4.4.1 , 4.4.3 - 4.4.9 Fatal error: Cannot instantiate non-existent class: domdocument in /in/YgiN1 on line 118
Process exited with code 255 . Output for 4.4.2 Fatal error: Cannot instantiate non-existent class: domdocument in /in/YgiN1 on line 119
Process exited with code 255 . Output for 4.3.0 - 4.3.1 Fatal error: Cannot instantiate non-existent class: domdocument in /in/YgiN1 on line 118
preferences:dark mode live preview
295.49 ms | 401 KiB | 460 Q