PHP help - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: PHP help (/showthread.php?tid=80411) PHP help by lordy on 12-25-2007 at 01:15 PM
Just got a quick question... if I'm creating a function in PHP, and I'm creating variables in said function. How do i make those variables available outside the actual function? I know how to make variables created outside the function available inside the function... but how do you do the reverse? code: I know that doesn't do anything but meh its an example... if what I understand is correct, to make those variables ($plus and $minus) available to other things outside the function, do i also need to add them to the global statement alongisde $blah and $blah2 inside the actual function?? RE: PHP Variables by Eljay on 12-25-2007 at 01:37 PM
You have to define the variable in the global scope first, e.g: code: RE: PHP help by lordy on 12-25-2007 at 01:38 PM
thanks Eljay, RE: PHP help by Eljay on 12-25-2007 at 01:42 PM
quote: yes. RE: PHP help by lordy on 12-25-2007 at 01:44 PM thankin you muchly master Eljay |