I can't figure out how do this at all. My first attempt involved using references and calling unset on a reference simply unlinks the reference. I tried recursion but couldn't get it to work, I then tried array_walk and array_filter without success. Here is a simple example that demonstrates what I am trying to do.
<?
class Sample {
//Please note this can have a completely variable amount of vars/dimensions
$data = array("system" => array("value1","value2"), "session" => array("value1"));
public function erase($value){
//Here I am suppose to somehow delete that exists in $this->data
}
public function display(){
print_r($this->data);
}
}
$Sample = new Sample();
$Sample->erase(array("system","value1"));
//I am extremely flexible on the format of the erase parameter ($value)
$Sample->display();
should output with the variable unset($this->data["system"]["value1"]) :
array("system" => array("value2"), "session" => array("value1")
Ohgodwhy helped by creating a eval.in with a slighly modified example
Thank you for your help