title: how to get href from within element using php and simple html dom
body: <p>I have an html page that looks a bit like this</p>
  
  <pre><code>xxxx
  &lt;a href="www.google.com"&gt;google!&lt;/a&gt;
  
  &lt;div class="big-div"&gt;
      &lt;a href="http://www.url.com/123" title="123"&gt;
      &lt;div class="little-div"&gt;xxx&lt;/div&gt;&lt;/a&gt;
  
      &lt;a href="http://www.url.com/456" title="456"&gt;
      &lt;div class="little-div"&gt;xxx&lt;/div&gt;&lt;/a&gt;
  &lt;/div&gt;
  xxxx
  </code></pre>
  
  <p>I am trying to pull of the href's out of the big-div.  I can get all the href's out of the whole page by using code like below.</p>
  
  <pre><code>$links = $html-&gt;find ('a');
  foreach ($links as $link) 
  {
      echo $link-&gt;href.'&lt;br&gt;';
  }
  </code></pre>
  
  <p>But how do I get only the href's within the div "big-div".
  Edit:
  I think I got it.  For those that care:</p>
  
  <pre><code>foreach ($html-&gt;find('div[class=big-div]') as $element) {
              $links = $element-&gt;find('a');
              foreach ($links as $link) {
                  echo $link-&gt;href.'&lt;br&gt;';
              }
          }
  </code></pre>