title: simple html dom not working
body: <p>I am trying to use simple html dom to parse my html data. But whenever i use the below code i get error as :-</p>
  
  <pre><code>Trying to get property of non-object
  </code></pre>
  
  <p>My code is:-</p>
  
  <pre><code>foreach($html-&gt;find('div.row') as $val)
          {
              $name = $val-&gt;find('h1')-&gt;innertext;
              echo $name;
          }
  </code></pre>
  
  <p>But when i use it like this i get the proper result:-</p>
  
  <pre><code>foreach($html-&gt;find('div.row') as $val)
          {
              foreach($val-&gt;find('h1') as $v)
               echo $v-&gt;innertext;
          }
  </code></pre>