$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)]["is_decoration"]="true";
$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)][$j]["image"]='';
$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)][$j]["bottom_right_x"]=$vv["bottom_right_x"];
$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)][$j]['bottom_right_y']=$vv["bottom_right_y"];
$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)][$j]['top_right_x']=$vv["top_right_x"];
$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)][$j]['top_right_y']=$vv["top_right_y"];
$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)][$j]['top_left_x']=$vv["top_left_x"];
$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)][$j]['top_left_y']=$vv["top_left_y"];
$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)][$j]['bottom_left_x']=$vv["bottom_left_x"];
$data['frame']["CollageDecoration"]["ClgD".$this->actionApiNumToWord($i+1)][$j]['bottom_left_y']=$vv["bottom_left_y"];
echo json_encode($data, JSON_UNESCAPED_SLASHES);
输出:
"ClgDFour": { // this 0 is integer but it give "0" like string index
"0": {
"image": "",
"bottom_right_x": "0.6973036342321218",
"bottom_right_y": "0.5270833333333333",
"top_right_x": "0.6973036342321218",
"top_right_y": "0.32708333333333334",
"top_left_x": "0.5885111371629543",
"top_left_y": "0.32708333333333334",
"bottom_left_x": "0.5885111371629543",
"bottom_left_y": "0.5270833333333333"
},
"is_decoration": "true"
}