I have a need for this. Is it possible?
I tried the following but it doesn't work:
$test;
function func_name() {
global $test;
$test = 'string';
}
echo $test; // I get nothing
I have a need for this. Is it possible?
I tried the following but it doesn't work:
$test;
function func_name() {
global $test;
$test = 'string';
}
echo $test; // I get nothing
If you don't call the function, nothing will happen.
You need to add func_name();
before echo $test;