note 22541 added to function.session-unregister

From: Date: Fri, 21 Jun 2002 15:02:30 +0000
Subject: note 22541 added to function.session-unregister
Groups: php.notes 
Request: Send a blank email to php-notes+get-32091@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) -- http://www.php.net/manual/en/function.session-unregister.php http://master.php.net/manage/user-notes.php?action=edit+22541 http://master.php.net/manage/user-notes.php?action=delete+22541 http://master.php.net/manage/user-notes.php?action=reject+22541

« previous php.notes (#32091) next »