I am trying to define a session variable as constant ...
define("MY_VAR", $_SESSION['variable_name']);
I start the session before accessing this constant
However, when I try to change the value of the variable ...
MY_VAR = "xyz"
... I get following message
"Parse error: syntax error, unexpected '=' in"
I am not sure what's happening here. It would be great if someone could shed some light on this.
Note: Instead, if I use $_SESSION['variable_name']
at all places where I used MY_VAR
, the code works fine