PHP - Call one function in another, retrieve variable -
this question has answer here:
why echoing variable test1() in test2() in following code not work? thought if execute function in 1 jsut if code placed in there. , how can make work?
function test1() { $var = "hallo"; } function test2() { var(); global $var; echo $var; } test2() ;
the $var variable isn't in scope of test2() function.
see: this post details.
Comments
Post a Comment