|
-
Mar 31st, 2008, 11:47 PM
#1
Thread Starter
Frenzied Member
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
Last edited by StrangerInBeijing; Apr 1st, 2008 at 12:22 AM.
-
Mar 31st, 2008, 11:58 PM
#2
Re: Make variable available inside function
PHP Code:
function myfunc() { global $level;
// ... }
-
Apr 1st, 2008, 12:22 AM
#3
Thread Starter
Frenzied Member
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|