I'm very new to PHP classes so forgive me if the answer is really obvious. I'm trying to figure out how to use a variable defined outside of a class inside of a class. Here is a very crude example
$myVar = 'value';
class myClass {
private $class_var = $myVar;
//REST OF CLASS BELOW
}
I know the above doesn't work, but how can I use the external $myVar inside the class?