0
以下xpath的作品,但我怎樣才能得到行號碼在哪裏xpath找到類'blah'的p元素?PHP XPath和行號
<?php
$doc = new DOMDocument();
$doc->loadHTML('<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
</head>
<body>
<p class='blah'>some text here</p>
</body>
</html>');
$xpath = new DOMXPath($doc);
$xpath_query = "//*[contains(@class, 'blah')]";
?>
乾杯馬克,猜我必須去搜索原始html。 – Kay 2011-06-14 19:51:09