$values= array();
$values[1]='test1';
$values[2]='test2';
$values[3]='test3';
$values[4]='test4';
echo '<u>Before:</u><br/>';
foreach ($values as $lang => $value)
echo $lang.' '.$value.'<br/>';
foreach ($values as $lang => &$value)
{
}
echo '<u>After reference:</u><br/>';
foreach ($values as $lang => $value)
echo $lang.' '.$value.'<br/>';
结果:
之前:
后:
为什么索引4等于test3?