参考:
//json_decode($json) 用来把json字符串 转换成json数组的函数

$json = json_decode($jsonstr, true);

//print_r($json);

$res = [];
$jsonname = $array['type_name'];
echo '<pre>';
foreach ($json['spec'][0]['value'] as $k => $v) {
$row = [
'type_name' => $jsonname,
'color' =>$v
];
$res[] =$row;
}
print_r($res);