日期:2014-05-17 浏览次数:20534 次
<?php $top = array( 'A' => array(), 'B' => array( 'B_b' => array(), ), ); $top['A']['parent'] = &$top; $top['B']['parent'] = &$top; $top['B']['B_b']['data'] = 'test'; print_r($top['A']['parent']['B']['B_b']); // array() ?>
$top = array( 'A' => array(), 'B' => array( 'B_b' => array(), ), ); $top['A']['parent'] = &$top; echo '<pre>'; print_r($top['A']['parent']); echo '</pre>'; echo '<pre>'; $top['B']['parent'] = &$top; echo '</pre>'; echo '<pre>'; print_r($top['B']['parent']); echo '</pre>'; echo '<pre>'; $top['B']['B_b']['data'] = 'test'; print_r($top['B']['B_b']); echo '</pre>'; echo '<pre>'; print_r($top['A']['parent']['B']['B_b']); // array() echo '</pre>'; echo '<pre>';