title: PHP: DomElement->getAttribute
body: <p>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.</p>
  
  <pre><code>$dom = new DOMDocument();
  @$dom-&gt;loadHTML(http://www.example.com);
  
  $a = $dom-&gt;getElementsByTagName("a");
  echo $a-&gt;getAttribute('href');
  </code></pre>
  
  <p>thanks!</p>