I know, I know… Declare it ouside the function first… This is a total beginner question.
Well, I’m trying to write something more advanced and I’m trying to keep my page extremely dynamic. That means that I need variables to create themselves dynamically, because I can’t guarantee what will be on the screen (user generated).
For example:
I have dynamic layers that could be named anything and I need to store the height and width of them, since those are also dynamic.
I can use eval() to create dynamic variable names, but, used inside functions, it’s worthless if I can’t use them in other places. So now the information is stored dynamically but it can’t be retrieved because it was lost when the function ended.
“Return value” is out of the question unless you have a really creative way of doing it.