Deleting first item of a $_COOKIE array
- by Mike Burke
if I add an item to the $_COOKIE array as such:
setcookie("favorites[]", "value", time()+3600);
I can delete any item from the $_COOKIE[favorites] array like this:
setcookie("favorites[$deletekey]", "", time()+3600);
EXCEPT the first one added so this does not work:
setcookie("favorites[0]", "", time()+3600*24);
How can I delete the first one and leave others intact?