title: Simple HTML Dom Parser - Can't put all href links into the same array after scraping them
body: <p>I'm trying to scrape a website with 2 or 3 href links for downloading pdfs. 
  this is the format of the webpage</p>
  
  <pre><code>&lt;p class="file"&gt;
                          &lt;a class="ext-pdf" rel="file" href="http://static-mpc.assaabloy.com/lockwoodfile/Fetchfile.aspx?id=2573&amp;amp;dl=1"&gt;Deadbolts Catalogue Section&lt;/a&gt;
                          &lt;span class="bdi"&gt;(.pdf, 660 kB)&lt;/span&gt;
                      &lt;/p&gt;
  
  
  
                      &lt;p class="file"&gt;
                          &lt;a class="ext-pdf" rel="file" href="http://static-mpc.assaabloy.com/lockwoodfile/Fetchfile.aspx?id=2625&amp;amp;dl=1"&gt;Lockwood Home Security Solutions&lt;/a&gt;
                          &lt;span class="bdi"&gt;(.pdf, 3.7 MB)&lt;/span&gt;
                      &lt;/p&gt;
  
  
  
                      &lt;p class="file"&gt;
                          &lt;a class="ext-pdf" rel="file" href="http://static-mpc.assaabloy.com/lockwoodfile/Fetchfile.aspx?id=3045&amp;amp;dl=1"&gt;Lockwood Elements Brochure&lt;/a&gt;
                          &lt;span class="bdi"&gt;(.pdf, 1.2 MB)&lt;/span&gt;
                      &lt;/p&gt;
  </code></pre>
  
  <p>So far I can get the links from the DOM but I cannot put them into the same array.
  This is my code:</p>
  
  <pre><code>foreach ($html-&gt;find('a.[class="ext-pdf"]') as $pdfurl) {
     $testarray=array($pdfurl-&gt;href);   
  
  
      print_r($testarray);
  
  }
  </code></pre>
  
  <p>And this is the output
      Array ( [0] => <a href="http://static-mpc.assaabloy.com/lockwoodfile/Fetchfile.aspx?id=2594&amp;dl=1" rel="nofollow">http://static-mpc.assaabloy.com/lockwoodfile/Fetchfile.aspx?id=2594&amp;dl=1</a>
   ) 
  Array ( [0] => <a href="http://static-mpc.assaabloy.com/lockwoodfile/Fetchfile.aspx?id=2625&amp;dl=1" rel="nofollow">http://static-mpc.assaabloy.com/lockwoodfile/Fetchfile.aspx?id=2625&amp;dl=1</a> )</p>
  
  <p>what am I doing wrong?
  thanks! :)</p>
  
  <p><strong>Here is the solution for anyone wondering:</strong></p>
  
  <pre><code>foreach ($html-&gt;find('a.[class="ext-pdf"]') as $pdfurl) 
  $testarray[] = $pdfurl-&gt;href."&lt;br&gt;";
  {
  
  
  
      print_r($testarray);
  
  }
  </code></pre>