【发布时间】:2011-03-04 13:12:06
【问题描述】:
我在 foreach 循环中通过引用访问数组,但 unset() 函数似乎不起作用:
foreach ( $this->result['list'] as &$row ) {
if ($this_row_is_boring) {
unset($row);
}
}
print_r($this->result['list']); // Includes rows I thought I unset
想法?谢谢!
【问题讨论】:
标签: php arrays reference foreach unset