This is what I do: I read file names in a directory and store them in an array, then I want to pass that array over to the next page like the same way you submit variables from a form to another page.
Global" in this context only applies to variables within a single script. It doesn't mean that the variable carries over to other scripts or even to multiple runs of a single script.
You could also apply Bastien's solution of serializing the array and embedding it in the form on your page your script produces. That serialization will then be passed to the subsequent script when the form is submitted.
That subsequent script can then unserialize the array and have the values available.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.