我有一个数组,里面有多个数组。我正在尝试更改键 ["517f467ca2ec9"] ["517f467ca310c"]... 但是假设我不知道数组键文本,我正在使用下面的代码片段,它给了我一个错误未定义的偏移量: 1
array(74) {
[0]=>
array(9) {
["517f467ca2ec9"]=>
string(0) ""
["517f467ca310c"]=>
string(0) ""
["517f467ca321a"]=>
string(0) ""
["517f467ca3320"]=>
string(0) ""
["517f467ca3427"]=>
string(0) ""
["517f467ca352a"]=>
string(0) ""
["517f467ca3666"]=>
string(0) ""
["517f467ca378d"]=>
string(0) ""
["517f467ca3897"]=>
string(0) ""
}
[1]=>
array(9) {
["517f467ca2ec9"]=>
string(0) ""
["517f467ca310c"]=>
string(0) ""
["517f467ca321a"]=>
string(0) ""
["517f467ca3320"]=>
string(0) ""
["517f467ca3427"]=>
string(0) ""
["517f467ca352a"]=>
string(0) ""
["517f467ca3666"]=>
string(0) ""
["517f467ca378d"]=>
string(0) ""
["517f467ca3897"]=>
string(0) ""
}
代码片段
foreach ($rows as $k=>$v){
$rows[$k] ['running_days'] = $rows[$k] [0];
unset($rows[$k][0]);
}