I have a session variable containing an array. I wish to unset a single element of the array and leave all the other elements (and keys) undisturbed. I am not working inside of a function.
I was doing this:
unset($_SESSION['dline_pcs'][$old_line_index]);
However, a few lines later when I do:
$z_pcs=array_sum($_SESSION['dline_pcs']);
The result $z_pcs still shows the sum including the supposedly deleted element. I know that doing unset inside of a function will not change the global variables, but this is not in any local function.
Can somebody tell me what I am doing wrong?
Thanks.