Say I have...
function one($x){
return $a + $x;
}
function two(){
$a = 5;
echo one(3);
}
Will this show the answer "8" or "3"? In other words, will function one get the value of $a or do I need to declare it global somewhere?
N.B. I haven't tried it yet, but I'm asking it here to understand WHY it acts one way or the other.
globalyou should pass it as a parameter, if you get to the point where your function needs lots of parameters then you should build a class, then all property's are available to that method. Dont make your code ugly!!!