title: How do I search a webpage for element using PHP?
body: <p>I want to search a webpage for <code>&lt;div class="contents"&gt;</code>, then I want to sort the data in a <code>foreach</code> block and save it to a file, I'm pretty sure how to do the latter but I need help with the initial <em>searching</em> of the webpage.</p>
  
  <p>Thanks.</p>
  
  <p>P.S. there are multiple <code>&lt;div class="contents"&gt;</code> elements on the webpage and I'm going to go through them all with a <code>foreach</code> block also.</p>