title: How to create DOM elements?
body: <p>I was going through simple HTML DOM parser and to create elements i found this syntax.</p>
  
  <pre><code>// Create DOM from URL or file
  $html = file_get_html('http://www.google.com/');
  
  // Find all images
  foreach($html-&gt;find('img') as $element)
         echo $element-&gt;src . '&lt;br&gt;';
  </code></pre>
  
  <p>but the problem is that i have all my HTML data in a variable say $html_data that i have fetched using curl and applied HTML tidy.
  When i try to use the syntax as :</p>
  
  <pre><code>// Create DOM from URL or file
  $html = file_get_html($html_data); // 
  
  // Find all images
  foreach($html-&gt;find('img') as $element)
         echo $element-&gt;src . '&lt;br&gt;';
  </code></pre>
  
  <p>What i think that it is not the correct syntax. Please correct if so.
  The error is something --> Call to a member function find() on a non-object in C:\wamp..
  This error seems like because i am using the wrong syntax (Not sure). Thanks.</p>