为什么?关于PHP数组和php foreach循环

时间:2010-09-09 02:43:15

标签: php

  

可能重复:
  Why does PHP overwrite values when I iterate through this array twice (by reference, by value)

$arr=array('a','b','c');

foreach($arr as &$v){
    echo $v;
}

foreach($arr as $v){
    echo $v;
}

结果是abcabb,而不是abcabc,为什么?

0 个答案:

没有答案