Laravel - 按标签拆分HTML并保存到数据库

I am trying to split some HTML and save it to my database. This is the HTML in question:

<p><strong>NSSDCA/COSPAR ID:</strong> 2009-038F</p>
<p>ANDE 2, the Atmospheric Neutral Density Experiment 2, is a pair of microsatellites (Castor and Pollux) launched from Cape Canaveral on STS 127 on 15 July 2009 at 22:03 UT and deployed from the payload bay of the shuttle on 30 July 2009 at 17:22 UT.</p>
<p><strong>Launch Date:</strong> 2009-07-15<br/><strong>Launch Vehicle:</strong> Shuttle<br/><strong>Launch Site:</strong> Cape Canaveral, United States<br/></p>

I get this HTML from a external website using a DOM Parser. What I want to do is to split this HTML in five columns for the mySQL database:

  • COSPAR
  • Description
  • Launch Date
  • Launch Vehicle
  • Launch Site

Would it be possible to do this? I have managed to do this with Guzzle for JSON and txt files but never HTML.

</div>

You can use Regex

Example code:

$re = '/<strong>.*?COSPAR.*?<\/strong>(.*)<\/p>\s<p>(.*)\s<p><strong>Launch Date:<\/strong>(.*?)<strong>Launch Vehicle:<\/strong>(.*?)<strong>Launch Site:<\/strong>(.*)/';

preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);

// Print the entire match result
var_dump($matches);