A rather cryptic title, but it's difficult to phrase.
Say I have an object from mysql_fetch_object(). I want to use a getter to return a value from a column.
For example, in a class, we have $this->data. How can I return say $this->data->id (ID column from table) using an argument from the getter function.
This won't work, but something along the lines of:
public function data($key)
{
return $this->data[$key];
}
Thanks for any help.