How PHP converts string data into an array and transmits it to the front end

I want to convert all the type data into an array and turn [product promotion, company introduction] into type: {[product promotion], [company introduction],}. This PHP code should be written, the Internet said to use foreach conversion, I try not successful, ask the boss to help.

Php
May.08,2021

cycle first, press, split


// 
$result = array_map(function($item){
    $item["type"] = explode("," , $item["type"]);
    return $item;
}, $arr);

< H2 > I seem to have reported a similar problem this morning. < / H2 >

toarray ();

Menu