foreach()一个有趣的现象(谁来解答下..)
$arr=array(1,2,3,4);
foreach($arr as &$value)
$value*=2;
print_r($arr);
echo "<br>".$value."<br>";
foreach($arr as $value)
$value*=2;
print_r($arr);
echo "<br>".$value."<br>";
显示的是
Array ( [0] => 2 [1] => 4 [2] => 6 [3] => 8 )
8
Array ( [0] => 2 [1] => 4 [2] => 6 [3] => 24 )
24
想不出这个24是怎么来的...哪位高人给解释下吧