<?php
class foo
{
public $a;
public function __construct()
{
$a='value';
}
}
$class = new foo();
echo $class->$a;
?>
I want to use the value $a in other parts of my script.
How do I retrieve a variable set in a php object and use it for other things outside of the object?