See json_decode in PHP manual.
Will probably need to loop over data and do whatever you need to with it after decoded.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
So I've got this mess.
(
[product_code] => "1234"
[0] => {"manufacturer_alias":"Kwickie Mart","manufacturer_code":"ABC","product_code":"1234"}
)
The goal is to insert json into a MySQL 5.6 table. This version of MySQL predates all the cool JSON functions SQL sometimes has.
[product_code] sometimes has multiple json values. By that I mean, there could be a [product_code] => "1234" with [0] => {something completely different but with the same keys}
Is there an easy way to aggregate these json values?
Failing that, is there an easy way to format the output of an array so that it can be sucked into a Laravel Database Seeder?
Many thanks in advance.
Please or to participate in this conversation.