"php: domelement->getattribute" Answer’s

0

"Inspired" by Simon's answer. I think you can cut out the getAttribute call, so here's a solution without it:

$attrs = array();
for ($i = 0; $i < $a->attributes->length; ++$i) {
  $node = $a->attributes->item($i);
  $attrs[$node->nodeName] = $node->nodeValue;
}
var_dump($attrs);
Wednesday, March 31, 2021
 
relipse
answered 11 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :