【发布时间】:2010-11-20 07:26:42
【问题描述】:
给定以下使用DOMDocument的PHP代码:
$inputs = $xpath->query('//input | //select | //textarea', $form);
if ($inputs->length > 0)
{
for ($j = 0; $j < $inputs->length; $j++)
{
$input = $inputs->item($j);
$input->getAttribute('name'); // Returns the Attribute
$input->getTag(); // How can I get the input, select or textarea tag?
}
}
如何知道每个匹配节点的标签名?
【问题讨论】:
标签: php dom xhtml domdocument