php - How to echo something outside of function? -


in following code want echo green outside of public function.

public function lol(){ $green ="green"; } 

for example want echo $green in following code.

public function green(){ echo"this $green"; } 

try following code :

function __construct() {        parent::__construct();        $green ="green";    }  public function green(){ echo"this $green"; } 

place $green variable in constructor.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -