📅  最后修改于: 2022-03-11 15:03:21.543000             🧑  作者: Mango
$collect = []; // empty array for collect customised inputs
foreach($request->all() as $input_key => $input_value){ // split input one by one
$collect[] = array( //customised inputs
"id" => $input_key,
"value" => $input_value
);
}
$result = json_encode($collect); //convert to json