I try to output my .php files from the command line and I want to be able to simulate $_SESSION values for this output.
I tried php test.php --define $_SESSION["id"]=1 but it does not set the global variable $_SESSION.
I am obviously not using the command line correctly but I cannot find how I should do.
Any idea to make it work?
Thanks a lot
EDIT: for my example test.php is the following:
<? echo $_SESSION['id'];?>
1 Answer