phppup Posted August 24, 2022 Share Posted August 24, 2022 I want to use elements from an array within a function. I had some success using global $array But then I read that using GLOBAL should be avoided (the explanation of why was not very clear) And that the same result could be achieved by attaching the array to a function (not sure how to do that) I was then thinking of creating an array of global variables. Is this even possible? What is the best way to access an array outside of a function so that its elements can be useful? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.