I have multiple global variables declared in an include, and i want to reference and use these variables in a function, but the function will not allow me to use these variables unless i (a)send all of the variables to the function, or (b)include the file in the function itself. Is there any way to make these variables truly global? My code looks like this:
//In the include.inc file:
global $var = "My value";
//In the code:
function my_function($thevar){
echo $var . $thevar;
}
my_function("test");
////////////////////////////
this leaves me with the output of:
test
any help would be greatly appreciated.
--GCON