iwato Posted June 9, 2017 Share Posted June 9, 2017 QUESTION: When a variable is passed via a super global from one file to another what happens to the variable that is passed? Where is it stored? What is its half-life? Roddy Link to comment Share on other sites More sharing options...
Ingolme Posted June 9, 2017 Share Posted June 9, 2017 A super global is available during the execution of the process. What do you mean by passing it to another file? If the file is included, it has access to all the superglobals of the file that included it. Link to comment Share on other sites More sharing options...
iwato Posted June 9, 2017 Author Share Posted June 9, 2017 Hi Ingolme, I was not clear. I want to know where the superglobal is stored? And, for how long I can use it and its contents after it has been sent. Based upon your response I should probably ask, if there is a way to pass a superglobal in such a way that it is permanently stored, and then accessible from any file with a get_file_contents( ) method. Roddy Link to comment Share on other sites More sharing options...
Ingolme Posted June 9, 2017 Share Posted June 9, 2017 The superglobal is like any other variable in the PHP process, it only exists during the time the script is running. If you want to store its value permanently somewhere you can use a database or write it to a file. If you want to store something for one user during a browsing session you can use PHP sessions. 1 Link to comment Share on other sites More sharing options...
iwato Posted June 9, 2017 Author Share Posted June 9, 2017 Quote If you want to store something for one user during a browsing session you can use PHP sessions. I am not there yet. Quote If you want to store its value permanently somewhere you can use a database or write it to a file. OK. This is what I needed to know. As ever, thank you, for your wonderful help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now