$lists = array(
"0" => array(
'id'=>1,
'name' => '测试1',
'time' => '3123'
),
"1" => array(
'id'=>1,
'name' => '测试1',
'time' => '4354'
),
"2" => array(
'id'=>1,
'name' => '测试1',
'time' => '6767'
)
);
$parent =& $lists[0];
$parent[$child][] =& $lists[1];
print_r($parent);
print_r($lists);
输出结果为:
Array
(
[id] => 1
[name] => 测试1
[time] => 3123
[_] => Array
(
[0] => Array
(
[id] => 1
[name] => 测试1
[time] => 4354
)
)
)
Array
(
[0] => Array
(
[id] => 1
[name] => 测试1
[time] => 3123
[_] => Array
(
[0] => Array
(
[id] => 1
[name] => 测试1
[time] => 4354
)
)
)
[1] => Array
(
[id] => 1
[name] => 测试1
[time] => 4354
)
[2] => Array
(
[id] => 1
[name] => 测试1
[time] => 6767
)
)
$lists 数组是怎样发生改变的,过程想不明白