Accessing the values of objects
| From: | John Nichel | Date: | Mon, 10 May 2004 18:18:04 +0000 |
| Subject: | Accessing the values of objects | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-185825@lists.php.net to get a copy of this message | ||
Hi,
OOP is not my strong suit, and I'm trying to work with someone else's code, but am having trouble accessing a value. Let's say I have an object called $bob, and doing a print_r on $bob produces this....
Array
(
[one] => this
[two] => that
[three] = Array
(
[alpha] => something
)
[_four] = Array
(
[beta] => another
[gamma] => Array
(
[word] => up
)
)
)
Now, I want to retrive the value of $bob->_four->gamma->word, but how? I've tried $bob->_four->gamma->word, $bob->_four['gamma']['word'], etc. I've also tried get_object_vars(), but for some reason 'word' isn't in the resulting array. Anyone? TIA
--
John C. Nichel
KegWorks.com
716.856.9675
john@kegworks.com