Possible Duplicate:
Get PHP class property by string
This is my original code:
function generateQuery($type, $language, $options)
{
// Base type
$query = $this->Queryparts->print['filter'];
// Language modifiers
// Additional options
return $query;
}
The "print" is an array/hash defined as an object (with "(object)" casting). I wish to do something like this:
$query = $this->Queryparts->$type['filter'];
To use the the $type variable as the object name. Is this possible?
$query = $this->Queryparts->{$type}['filter'];