I have a session variable containing an array. I wish to delete a single element of the array and leave all the other elements (and keys) undisturbed. I have been trying to use "unset()" to do this.
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 inside any local function.
Can somebody tell me what I am doing wrong? Mayby I'm using the wrong array function?
Thanks.