1

ive been trying for a while now trying to get a value from this std object

stdClass::__set_state(array(
   'regions' => 
  array (
    0 => 
    stdClass::__set_state(array(
       'id' => 1,
       'name' => 'Canada',
       'image_url' => 'https://s3-us-west-2.amazonaws.com/staticimageskiind/flags/[email protected]',
    )),
    1 => 
    stdClass::__set_state(array(
       'id' => 2,
       'name' => 'USA',
       'image_url' => 'https://s3-us-west-2.amazonaws.com/staticimageskiind/flags/[email protected]',
    )),
    2 => 
    stdClass::__set_state(array(
       'id' => 3,
       'name' => 'Global',
       'image_url' => 'https://s3-us-west-2.amazonaws.com/staticimageskiind/flags/[email protected]',
    )),
    3 => 
    stdClass::__set_state(array(
       'id' => 4,
       'name' => 'Australia',
       'image_url' => 'https://s3-us-west-2.amazonaws.com/staticimageskiind/flags/[email protected]',
    )),
  ),
   'info' => 
  stdClass::__set_state(array(
     'code' => 'INFO_MARKETPLACE_RETRIEVED_REGIONS',
     'name' => 'Marketplace Regions Retrieved',
     'message' => 'A list of marketplace regions has been retrieved.',
  )),
));

but i can't seem to get a value from this object, help would be appreciated, ive searched online but couldnt find out a solution

2
  • i think you are using drupal , try with $VARIABLE->__get('regions'); Commented May 8, 2017 at 7:37
  • Do you tried to use $object->regions ? If not try to give more informations about what you already tried. Commented May 8, 2017 at 7:40

2 Answers 2

3

Did you try:

echo $object->regions[0]->name;

For example?

Sign up to request clarification or add additional context in comments.

Comments

0

i have managed to get the correct output i wanted by

$abc = $result->regions;
echo $abc[1]->name;

hope this helps anyone in need

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.