正确:
array( "a" => "1", ), ); foreach ($arr as $a => &$trdata) { $trdata['b'] = $trdata['a']; } var_dump($arr);?>
错误:
array( "a" => "1", ), ); foreach ($arr as $a => $trdata) { $trdata['b'] = $trdata['a']; } var_dump($arr);?>
本文共 383 字,大约阅读时间需要 1 分钟。
正确:
array( "a" => "1", ), ); foreach ($arr as $a => &$trdata) { $trdata['b'] = $trdata['a']; } var_dump($arr);?>
错误:
array( "a" => "1", ), ); foreach ($arr as $a => $trdata) { $trdata['b'] = $trdata['a']; } var_dump($arr);?>
转载于:https://www.cnblogs.com/frostbelt/archive/2013/06/03/3115372.html