提取td标记的属性值(php)
多谢各位 在此处使用XPath:提取td标记的属性值(php),php,regex,domdocument,Php,Regex,Domdocument,多谢各位 在此处使用XPath: <tr> <td>New order info</td> <td class="emailid"><input type="button" class="product product-info" value="View product" onclick="popupWindow('viewproduct.php?id=481244','emlmsg',650,400)" /></td> &
<tr>
<td>New order info</td>
<td class="emailid"><input type="button" class="product product-info" value="View product" onclick="popupWindow('viewproduct.php?id=481244','emlmsg',650,400)" /></td>
</tr>
<tr
$DOMNodelist = $doc->getElementsByTagName('td');
foreach($DOMNodelist as $DOMElements) {
if ($DOMElements->nodeValue == "New order info") {
...................
}
}
$html=项目(0);
var_dump($td);
上面的示例选择前面带有“新订单信息”的
节点。但是,td标签没有id属性。太棒了!非常感谢你!很高兴看到它帮助了你
<tr>
<td>New order info</td>
<td class="emailid"><input type="button" class="product product-info" value="View product" onclick="popupWindow('viewproduct.php?id=481244','emlmsg',650,400)" /></td>
</tr>
<tr