PHP - Call one function in another, retrieve variable -


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

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -