Tuesday, 15 January 2013

php - Item not deleted from array session -


I have a simple PHP code that should delete the key given from an array ($ item - and passing). There is a session, there is an item, but on every attempt, the entire session is approved.

  $ _ session ['myFavorites'] = array (); If (in_array ("$ item", $ _SESSION ['myFavorites'])) {without set ($ _ session ['myFavorites'] [$ items]); }   

Any help might reset my mind again. I hope someone can tell me what I'm doing wrong.

  $ _ session ['myFavorites'] = array (); If (array_key_exists ($ item, $ _SESSION ['myFavorites'])) {without set ($ _ session ['myFavorites'] [$ item]); }    

No comments:

Post a Comment