Freedom-n-Democrazy Posted October 12, 2011 Share Posted October 12, 2011 Is there a way to make it How can I go about removing a $_SESSION entity if certain array values of it equal a specific value? I am thinking something along the lines of this: if (isset($_SESSION['cart']['content'][$_POST['id']])) = array ('sizes' => 0, 'sizem' => 0, 'sizel' => 0, 'sizexl' => 0) { // remove $_SESSION['cart']['content'][$_POST['id']] } Link to comment https://forums.phpfreaks.com/topic/248965-removing-a-_session-entity-if-values-x/ Share on other sites More sharing options...
ManiacDan Posted October 12, 2011 Share Posted October 12, 2011 You'll have to use a loop to check all these keys one at a time, deleting the item and BREAKing out of the loop when you find a match. Link to comment https://forums.phpfreaks.com/topic/248965-removing-a-_session-entity-if-values-x/#findComment-1278570 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.