Ver originalforeach($_SESSION as $k => $qty){ if (substr($k,0,3)=='***' && ($qty>=0)){ $_SESSION[$k] = ""; }}