我正在尝试将每个数组上的 reviewCount 更新为 1。我很困惑为什么我的 foreach 循环不会更新它。任何帮助将不胜感激
$输出:
Array(
[1] => Array(
[category] => Category 1
[country] => USA
[date] => 2012-04-07 23:50:49
[name] => Product 1
[reviewCount] =>
)
[2] => Array(
[category] => Category 1
[country] => USA
[date] => 2012-04-07 23:50:49
[name] => Product 1
[reviewCount] =>
)
代码:
foreach ($output as $row) {
$row['reviewCount'] = 1;
}