Quote:
Originally Posted by CarCdr
It's probably a scoping problem. Scoping in PHP is, well, lacking. In your function, if you want to reference a variable outside the function, such as $DB_site, or $bbuserinfo, or whatever, you have to declare it as global. You would do so using something like the following inside your function:
global $DB_site, $bbuserinfo;
|
Does that need to work in both directions? In other words, do I have to do that for variables created inside the function if I need to reference them outside of the function?
Also, that process is not insignificant in size for a function that references/uses many variables. Is there any way I can easily state that I want ALL variables within the function to be Global?