我有一个看起来像...的数组
$arr = array(
array(
"server_name" => "server_a",
"server_number" => "1",
"server_status" => "OPEN"
),
array(
"server_name" => "server_b",
"server_number" => "2",
"server_status" => "CLOSED"
)
);
我正在尝试通过以下方式设置“server_status”的索引值
foreach($arr as $a){
$a['server_status'] = "STATUS_".$a['server_status'];
}
这似乎不是设置数组值的正确方法,因为似乎什么都没有发生,执行此任务的正确方法是什么?