Is it possible to remove an array element by a pointer?
Multidimensional array:
$list = array(
1=>array(
2=>array('entry 1'),
3=>array('entry 2')
),
4=>'entry 3',
5=>array(
6=>array('entry 4')
)
);
Reference array:
$refs = array(
1=>&$list[1],
2=>&$list[1][2],
3=>&$list[1][3],
4=>&$list[4],
5=>&$list[5],
6=>&$list[5][6]
);
The reference array contains only pointer (alias) to the multidimensional array elements. Now I want to delete (unlink) the elements from the $list array.
By using
$n=3; unset($refs[$n])but PHP only deletes the pointer.
Thanks for any help.