0

If I do a print_r() statement to show me the content of my object it returns this:

stdClass Object ( [groupData] => {"global":["CoolPerson","Person"]} [permissionData] => {} )

How can I return the String "CoolPerson"?

I already tried the following:

$myObject['global'][0]

and

$myObject['groupData']['global'][0]
1
  • What is groupData? A global, variable, string... etc? Commented Aug 1, 2019 at 20:49

1 Answer 1

1

It looks like the groupData property of your object is a JSON string. You should try this:

json_decode($myObject->groupData)->global[0]
Sign up to request clarification or add additional context in comments.

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.