vineld Posted July 8, 2009 Share Posted July 8, 2009 I have encountered an object that contains an unnamed array that looks like this: stdClass Object ( [string] => Array ( [0] => 1 [1] => 4 [2] => 14 ) ) How do I access that array? Quote Link to comment Share on other sites More sharing options...
WolfRage Posted July 8, 2009 Share Posted July 8, 2009 you var dumped it correct? What did you var dump? Replace $soemthing in my code. <?php $something[]// if you want a specific key just specify. Else to go through it all use a foreach. ?> Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 8, 2009 Share Posted July 8, 2009 foreach($obj->string as $num) echo $num; Quote Link to comment Share on other sites More sharing options...
vineld Posted July 8, 2009 Author Share Posted July 8, 2009 Thanks, just figured that out myself, it is actually called string =) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.