title: file_get_contents VS dom->loadHTMLFile
body: <p>I've been making a PHP crawler that needs to get all links from a site and fire those links (instead of clicking it manually or doing client-side JS).</p>
  
  <p>I have read these:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/2313107/how-do-i-make-a-simple-crawler-in-php">How do I make a simple crawler in PHP?</a></li>
  <li><a href="https://stackoverflow.com/questions/3577641/how-do-you-parse-and-process-html-xml-in-php">How do you parse and process HTML/XML in PHP?</a></li>
  </ol>
  
  <p>and others more, and I decided to follow 1.</p>
  
  <p>So far it has been working, but I have been baffled by the difference in the approach of using <code>file_get_contents</code> against <code>dom-&gt;loadHTMLFile</code>. Can you please enlighten me with these and the implications it might cause, pros and cons, or simple versus scenario.</p>