考虑:
array (size=1)
0 =>
array (size=5)
'name' => string '15268459735 Farming and Projects XXXXX' (length=38)
'region' => string '2' (length=1)
'entitynumber' => string '2012/002086/24' (length=14)
'ownership' => string '6' (length=1)
'id' => string '26249' (length=5)
为什么以下内容仍然返回没有owner
元素的相同数组?
foreach ($result as $row)
{
$row['owner'] = 1;
}
答案 0 :(得分:5)
尝试passing the array by reference:
foreach ($result as &$row) {
$row['owner'] = 1;
}