I'm looking for a way to create a new object with the help of a variable, but instead of referencing it by the variable I want to reference it by the value of the variable.
$name = "moduleAjax";
$name = new $name;
And instead of doing this,
$name->method();
I would do this,
$moduleAjax->method();
I don't have a live example of my code. I've been experimenting a little bit but I can't find a solution.
Any help would be greatly appreciated.