PHP script that fetch a string into array and insert/update Database

Job ID: 33750929

Budget: €30 – €250 EUR

I have a script thats checks a website for mixed content and gives a string as $output

like this:
OUTPUT :[2022-05-21 16:52:24] MCS.NOTICE: Scanning https://www.domain.com/ [2022-05-21 16:52:24] MCS.INFO: 00000 - https://www.domain.com/ [2022-05-21 16:52:24] MCS.INFO: 00001 - https://www.domain.com/index.html [2022-05-21 16:52:24] MCS.INFO: 00002 - https://www.domain.com/workshops.html [2022-05-21 16:52:24] MCS.INFO: 00003 - https://www.domain.com/arrangementen.html [2022-05-21 16:52:24] MCS.INFO: 00004 - https://www.domain.com/about.html [2022-05-21 16:52:24] MCS.INFO: 00005 - https://www.domain.com/faq.html [2022-05-21 16:52:24] MCS.INFO: 00006 - https://www.domain.com/reserveren.html [2022-05-21 16:52:24] MCS.ERROR: 00007 - https://www.domain.com/contact.html [2022-05-21 16:52:24] MCS.WARNING: http://www.domain.com/images/ie8-panel/warning_bar_0000_us.jpg [2022-05-21 16:52:24] MCS.INFO: 00008 - https://www.domain.com/privacy-policy.html [2022-05-21 16:52:24] MCS.NOTICE: Scanned 9 pages for Mixed Content

I need php code that check this string, split it into 2 arrays
$broken = [];
$working = [];

And put the results in MySQL DB

Like this
- Scan must be stored in DB mixedcontentscan (urlid, datetime, #errors)
INSERT INTO mixedcontentscans (urlid, datetime, errors) VALUES ($website['urlid'], $now, $errors)

- Select previous found mixed content pages from DB mixedcontendetails and store in array
- Compare the 2 arrays and update if needed the DB mixedcontendetails

- insert the new found: insert urlid, urlwithmixedcontent, set datetime since, hasmixed=1

- update the solved: urlwithmixedcontent, set datetime solved, hasmixed=0
Related categories: PHP MySQL Regular Expressions