$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);
More Related Contents:
- How to insert HTML to PHP DOMNode?
- PHP DOMDocument getting Attribute of Tag
- Grabbing the href attribute of an A element
- Remove a child with a specific attribute, in SimpleXML for PHP
- How to saveHTML of DOMDocument without HTML wrapper?
- Getting DOM elements by classname
- How to return outer html of DOMDocument?
- PHP XML how to output nice format
- Disable warnings when loading non-well-formed HTML by DomDocument (PHP)
- Parse HTML with PHP’s HTML DOMDocument
- How to delete element with DOMDocument?
- How to extract a node attribute from XML using PHP’s DOM Parser
- PHP DOMDocument errors/warnings on html5-tags
- Best way to transfer an array between PHP and Javascript [duplicate]
- Fix malformed XML in PHP before processing using DOMDocument functions
- What’s the difference between PHP’s DOM and SimpleXML extensions?
- DOM parser that allows HTML5-style
- Using PHP to get DOM Element
- Why doesn’t var_dump work with DOMDocument objects, while print($dom->saveHTML()) does?
- Convert clickable anchor tags to plain text in html document
- CakePHP Xml utility library triggers DOMDocument warning
- Call to undefined method DOMDocument::getElementsByClassName() [duplicate]
- PHP DOM get nodevalue html? (without stripping tags)
- How do you rename a tag in SimpleXML through a DOM object?
- How do I iterate through DOM elements in PHP?
- Strip HTML tags and its contents
- How to remove an HTML element using the DOMDocument class
- How to import XML string in a php DOMDocument
- Wrap DOM element in another DOM element in PHP
- Debug a DOMDocument Object in PHP