How can I take all the attribute of an element? Like on my example below I can only get one at a time, I want to pull out all of the anchor tag\'s attribute.
$length = $a->attributes->length; $attrs = array(); for ($i = 0; $i < $length; ++$i) { $name = $a->attributes->item($i)->name; $value = $a->getAttribute($name); $attrs[$name] = $value; } print_r($attrs);