Why does echoing the variable from test1() in test2() in the following code not work? I thought if I execute a function in another one it is jsut as if the code was placed in there. And how can I do it to make it work?
function test1() {
$var = "Hallo";
}
function test2() {
var();
global $var;
echo $var;
}
test2() ;