I'm trying to add an array into an other array at a specific key. But I have this message :
array_push() expects parameter 1 to be array, null given
I don't understand because in the else I create the array.
$key = $this->input->get('vente');
if(array_key_exists($key,$this->session->userdata('panier'))){
array_push($this->session->userdata('panier')[$key],$toAdd);
}else{
$this->session->userdata('panier')[$key] = array();
array_push($this->session->userdata('panier')[$key],$toAdd);
}