note 22541 deleted from function.session-unregister by sniper

From: Date: Thu, 31 Oct 2002 00:51:00 +0000
Subject: note 22541 deleted from function.session-unregister by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-38793@lists.php.net to get a copy of this message
I had an array, which I registered. I wanted to replace the contents of the array, as follows: unset($cardbox_results); session_unregister($cardbox_results); for ($i = 0; $i < $num_entries; $i++) $cardbox_results[$i] = $cardbox_matches[$i][cardbox_id]; session_register('cardbox_results'); Unfortunately what I got was an array containing any of the new entries, plus some of the old entries (assuming the new array was shorter). To get around this I had to add the following line to the code at the end of this function: $HTTP_SESSION_VARS["cardbox_results"] = $cardbox_results; (PHP 4.1.1)

« previous php.notes (#38793) next »