PHP variable transfer problem.
I include an A. PHP file, use a. PHP variables, but I wrote a function, in this function can not access the variable, 1, I use parameters passed in is not used; 2, I include a in the function. PHP, too, is useless.
How can a function access this external file a. PHP variables?
------Solution--------------------
I do not know how you write config.php, I tried a bit, is can get, function A in the echo $TEXTTPL changed to $TEXTTPL on it.
config.php
$TEXTTPL = ' 123 ';
?>
Include_once ("config.php");
Echo $TEXTTPL; 123
$resultS = A ($TEXTTPL); No display
function A ($TEXTTPL) {
Echo $TEXTTPL; This is a small write, you used to write before, of course not
}
Output 123123
------Solution--------------------
References:
variables are case-sensitive!
The Mandarin is: The variable is case-sensitive
Also need to be prompted, specific below to find
{
Echo $TEXTTPL;
}