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?
for example:
code:
$blah = 2;
$blah2 = 4;
function yay() {
global $blah, $blah2;
$minus = $blah2 - $blah;
$plus = $blah + $blah2;
}
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??