Is it possible to instantiate a class using a variable as the class name? For example, I tried to instantiate a class from within another class using the following:
$db = new $this->dbclass;
$this->dbclass was set to the name of the class I was trying to instantiate. But it didn't work.
I also tried using a constant as the class name as follows:
define ("DBCLASS", $this->dbclass);
$db = new DBCLASS;
But that didn't work.
What's the best way to do this?