我有这个数组:
$rows = array_map(function($item) {
return (object) ['c' => [
(object) ['v' => $item->job_type, 'f' => null],
(object) ['v' => intval($item->count), 'f' => null]
]];
}, array_values($data));
echo json_encode($data);
输出如下:
{"1":{"job_id":"1","count":"8","job_type":"0"},"3":{"job_id":"3","count":"7","job_type":"1"}}
我想从" 0"更改作业类型的值到"工作"和" 1"实习。
我该怎么做?