note 26517 added to function.session-register

From: Date: Sat, 02 Nov 2002 11:20:40 +0000
Subject: note 26517 added to function.session-register
Groups: php.notes 
Request: Send a blank email to php-notes+get-38902@lists.php.net to get a copy of this message
just an add-on to my first note: if you want the same behaviour using the $_SESSION[] array as when using session_register() pass the variable in question by reference. i.e: <?PHP session_start(); echo $_SESSION['i']; $i = 2; $_SESSION['i'] = &$i; $i = 3; echo '<a href="'.$PHP_SELF.'">click here</a>'; ?> this will result in $_SESSION['i'] having the value of 3 after the fist click, just as if you were using session_register(). greetings -- http://www.php.net/manual/en/function.session-register.php http://master.php.net/manage/user-notes.php?action=edit+26517 http://master.php.net/manage/user-notes.php?action=delete+26517 http://master.php.net/manage/user-notes.php?action=reject+26517

« previous php.notes (#38902) next »