protected getNodeValueByTagName ( DOMElement $node, $tagName ) : boolean | string | ||
$node | DOMElement | |
$tagName | ||
return | boolean | string |
protected function getNodeValueByTagName(DOMElement $node, $tagName)
{
$results = $node->getElementsByTagName($tagName);
for ($i = 0; $i < $results->length; $i++) {
$result = $results->item($i);
if (!$result->nodeValue) {
continue;
}
return $result->nodeValue;
}
return false;
}