title: Simple HTML DOM getting all attributes from a tag
body: <p>Sort of a two part question but maybe one answers the other.  I'm trying to get a piece of information out of an 
  
  <pre><code>&lt;div id="foo"&gt;
  &lt;div class="bar"&gt;&lt;a data1="xxxx" data2="xxxx" href="http://foo.bar"&gt;Inner text"&lt;/a&gt;
  &lt;div class="bar2"&gt;&lt;a data3="xxxx" data4="xxxx" href="http://foo.bar"&gt;more text"&lt;/a&gt;
  </code></pre>
  
  <p>Here is what I'm using now. </p>
  
  <pre><code>$articles = array();
  $html=file_get_html('http://foo.bar');
  foreach($html-&gt;find('div[class=bar] a') as $a){
      $articles[] = array($a-&gt;href,$a-&gt;innertext);
  }
  </code></pre>
  
  <p>This works perfectly to grab the href and the inner text from the first div class. I tried adding a $a->data1 to the foreach but that didn't work. </p>
  
  <p>How do I grab those inner data tags at the same time I grab the href and innertext.   </p>
  
  <p>Also is there a good way to get both classes with one statement? I assume I could build the find off of the id and grab all the div information. </p>
  
  <p>Thanks</p>