Here is my session array:
[inactivefilter] => Array
(
[0] => add
[1] => new
)
[filter] => Array
(
[0] => new
)
‘Add’ and ‘New’ are dynamically generated by the user.
I currently send the value of the array to my controller, then am stuck on what the model should do.
public function clear_filter()
{
$i = $this->input->post('filtervalue');
$this->thread_model->clear_filter($i);
}
$i would equal whatever value they click on. So if they clicked ‘add’ $i = add
I need to unset both activefilter and filter based on whatever the value of $i is. Is there an easy way to do it?
I’ve read about array_splice, array_diff, and some other ways, but had no success.
Using codeigniter sessions:
Using php sessions: