如何編輯“風(fēng)”數(shù)組?例如,我希望速度為“3”?$forecast = [ "temperature" => "", "precipitation" => array("min-value", "max-value"), "wind" => [ "speed" => "", "side" => "", ]];
1 回答

犯罪嫌疑人X
TA貢獻(xiàn)2080條經(jīng)驗(yàn) 獲得超4個(gè)贊
您可以通過(guò)以下方法修改數(shù)組:
$forecast['temperature'] = 100500
$forecast['wind']['speed'] = 3
你也可以從數(shù)組中獲取數(shù)據(jù):
$temperature = $forecast['temperature'];
$speed = $forecast['wind']['speed']
- 1 回答
- 0 關(guān)注
- 154 瀏覽
添加回答
舉報(bào)
0/150
提交
取消