title: Split HTML into array (PHP)
body: <p>I'm having to receive data from function which returns <code>HTML</code>. The best solution would be to edit the code to work better but with it being live code and not being my code. I can't edit this. </p>
  
  <p>So could I get some guidance to help achieve what I need: </p>
  
  <p>Returned html: </p>
  
  <pre><code>&lt;a href="/newsitems"&gt;News&lt;/a&gt;
  &lt;a href="/news/roman-catapults/16465"&gt;Roman Catapults&lt;/a&gt;
  &lt;a href="/news/year-3-roman-experience/13835"&gt;Year 3 Roman Experience&lt;/a&gt;
  &lt;a href="/news/year-3-dewa-roman-experience/15746"&gt;Year 3 Dewa Roman Experience&lt;/a&gt;
  &lt;a href="/news/science-week-day-1/15423"&gt;Science Week&lt;/a&gt;&lt;a href="/news/world-book-day/15104"&gt;World Book Day&lt;/a&gt;
  &lt;a href="/news/year-6-trip-to-the-lion-salt-works/15762"&gt;Year 6 trip to the Lion Salt Works&lt;/a&gt;&lt;a href="/news/learning-logs/13839"&gt;Learning Logs&lt;/a&gt;
  &lt;a href="/news/working-together/13838"&gt;Working Together&lt;/a&gt;
  &lt;a href="/news/learning-logs/13837"&gt;Learning Logs&lt;/a&gt;
  &lt;a href="/news/year-2-curriculum-map-for-autumn-2/13377"&gt;Year 2 Curriculum Map for Autumn 2&lt;/a&gt; 
  </code></pre>
  
  <p>I know there is methods such as </p>
  
  <ul>
  <li>regex</li>
  <li>explode</li>
  <li>implode</li>
  </ul>
  
  <p>However my knowledge on this isn't the greatest and would like a little guidance to help me learn.</p>
  
  <p>What i'm trying to achieve: </p>
  
  <ul>
  <li>Trying to break each line into an array</li>
  <li>Getting the text from the link and also the link</li>
  <li>E.g. the first line <code>array =&gt; (title =&gt; "News", link =&gt; "/newsitems")</code></li>
  </ul>
  
  <p>Reason: </p>
  
  <p>I can't edit the function which returns this <code>HTML</code> and I want to display the HTML better than the returned data.</p>