Date: 02/20/09 (PHP Development) Keywords: no keywords I am hoping someone can point me in the right direction. class myClass { private $data = array() public function __construct($newData=array()) { $this->setData($newData); } public function getData() { return $this->data; } public function setData($newData=array()) { $this->data = $newData; } } $dataObj = new myClass($someDataArray); // I want to be able to do. print $dataObh['myArrayKey'] // and get back the data that that key holds in the object $data variable I know it can be done, I just don't know the specifics, and I think it has something to do with Obect Iteration, but the docs are confusing me. Thanks.
|