John Nichel wrote:
Michael Sims wrote:
John Nichel wrote: Are you sure $bob is an object? It says above that it's an array. If $bob were an object, print_r() should give "objectname Object" instead of "Array".
Nah, that's just my bad typing without thinking. When I print_r($bob), it does start....
bob Object
Well, in that case let me address your original post:
John Nichel wrote:
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'],
That last one ($bob->_four['gamma']['word']) should work. It does here. This test script:
---begin quote--- class bob {
var $one; var $two; var $three; var $_four;
function bob() { $this->one = 'this'; $this->two = 'that'; $this->three = array('alpha' => 'something'); $this->_four = array( 'beta' => 'another', 'gamma' => array('word' => 'up') ); }
}
$bob = new bob; print_r($bob); print $bob->_four['gamma']['word']."\n"; ----end quote----
prints:
---begin quote--- bob Object ( [one] => this [two] => that [three] => Array ( [alpha] => something )
[_four] => Array ( [beta] => another [gamma] => Array ( [word] => up )
)
) up ----end quote----
Do you get different results?
Yeah, I get an empty value for the object I'm working with (quite a bit bigger than the example I posted) when I try to retrive the individual value, but the print_r of the object shows that it has value. I thought my syntax was wrong, but I guess I have to keep digging to find out where the 'trouble' is. Thanks for the help.
Aaargh, I hate going behind other people. >:-(
-- John C. Nichel KegWorks.com 716.856.9675 [EMAIL PROTECTED]
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php