So I think this is partly a scope problem, but it’s not as simple as that. I have one function that calls another function that is recursive, and each function, in addition to returning some data, also needs to edit a variable in the parent function. I think I could define the variable at the start of the page and use global, but there are some issues with that, too. I think some of the problem is also that I just don’t know the methods or functions that might exist that do what
But basically, I have one function that eventually calls a second function, and the second function is already responsible for returning an array, but in addition I need it to modify the values of a half-dozen variables in the parent function. I don’t think I can use global because the variables are defined within the parent function, not at the start of the page. What’s the best practice for this kind of thing?