‘Lo All,
I’m learning PHP from an ASP background. I’ve searched found and read some articles on PHP’s variable scope but can’t find –or need help finding– something that addresses the scope of session variables.
That just sounds funny to ask. I’d have thougth that a session variable is a session variable no matter where when or how it’s defined.
[code=php]session_start();
function SomeFunction(){
$_session[‘SomeVarName’] = ‘of Value’;
}
//calling the function
SomeFunction();
echo ‘there should be something ‘. $_session[‘SomeVarName’] .’ here.’;
So comes the question, how can I assign a session variable and make it available in and out of functions? “global $_session[‘SomeVarName’];” doesn’t seem to be doing the trick.
Any insight you could offer or even links to related articles would be welcomed.
Respectfully,
Micke