Hi,
I am having a problem and can't see what is going on.
I have an associative array, I remove an item from the array that has two items in it, then I check if the count of elements is zero and even though it is one, it executes the code as if the count was zero. I used error_log to check the values.
if (isset($_SESSION['EOs'][$id]))
{
error_log("\n(before unset)count[session[EOs]=".count($_SESSION['EOs']),3,"debug.txt");
unset ($_SESSION['EOs'][$id]);
error_log("\nrules_fns...(after unset)count[session[EOs]=".count($_SESSION['EOs']),3,"debug.txt");
if (count($_SESSION['EOs'] == 0))
unset ($_SESSION['EOs']);
}
In error log file I get:
(before unset)count[session[EOs]=2
(after unset)count[session[EOs]=1
Yet, $_SESSION['EOs'] gets unset!!
Thanks for your help.