referencing a session using a local variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
talorlik
Forum Newbie
Posts: 6
Joined: Tue Jul 13, 2004 3:54 am

referencing a session using a local variable

Post by talorlik »

hi all,

if i reference a session using the following code:

Code: Select all

<php $myvar = &$_SESSION['myvar'] ?>
does that mean that when i unset the local variable i also unset the session???

cheers,
Tal.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

IIRC, yes. everything you do to $myvar outside of another =& will affect the actual variable.
Post Reply