For example, when I can set cookie array like this
for ($index=0; $index<5; $index++)
{
setcookie("mycookiearray[$index]", $index);
}
Next page when I call the cookie
for ($index=0; $index<count($mycookiearray); $index++)
{
echo($mycookiearray[$index]);
echo("<br>");
}
It will shows me
1
2
3
4
Now I want to only delete the last element of the cookie array $mycookiearray (not just set the value to null but actually delete that element physically.) and then when I call the
count($mycookiearray) it should return 4 instead of 5.
How can I do that?
Thanks!