unset a element of an array via reference

djmojo

New Member
I can access anywhere inside the multi-dimensional an array via reference method. And I can change the its value. For example:\[code\]$conf = array( 'type' => 'mysql', 'conf' => array( 'name' => 'mydatabase', 'user' => 'root', 'pass' => '12345', 'host' => array( '127.0.0.1', '88.67.45.123', '129.34.123.55' ), 'port' => '3306' ));$value = http://stackoverflow.com/questions/3662714/& $this->getFromArray('type.conf.host');$value = 'http://stackoverflow.com/questions/3662714/-- changed ---';// result$conf = array( 'type' => 'mysql', 'conf' => array( 'name' => 'mydatabase', 'user' => 'root', 'pass' => '12345', 'host' => '-- changed ---' 'port' => '3306' ));\[/code\]BUT, I can't destroy the that section: \[code\]// normally successunset($conf['type']['conf']['host']);// fail via reference$value = http://stackoverflow.com/questions/3662714/& $this->getFromArray('type.conf.host');unset($value);\[/code\]Is there a solution?
 
Back
Top