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'];?>
session_start()anywhere in the php file?$_SESSIONand wondered if I could use this global variable as a regular variable. I will try with it.session_start(), the$_SESSIONvariable is set toarray(), which is not the cas if I do not do it (I checked withprint_r. Everything looks like my --define does not do anything (or at least not what I expect)$_SESSIONvariable). Now I am trying to output a static version of my connected page to build a native app with phone gap, that does not know PHP. I want to write a script that exports the logged in version of the page to a standard HTML I use in my phonegap app. Does it make sense? Any easier way to achieve this?