Make variable available inside function
I declare and set a variable ($level) on each and every page.
of course this variable is available in all my included files, so that is fine.
but just now i start including files with functions inside, and realized (after hour or two scratching my head) that such variables are not available inside my functions.
is there other ways than actually passing this variable to my functions asan argumetn to make it available in there, because this method feel pretty clumpsy to me.
cheers
Re: Make variable available inside function
PHP Code:
function myfunc()
{
global $level;
// ...
}
Re: Make variable available inside function
Strange I can swear I tried that earlier and it did not work.
Anyhow, that just do the job. Thanks!