stdClass Object (
[id] => 8586332
[email] => hello@myemail.com
[optInType] => Unknown
[emailType] => Html
[dataFields] => Array
(
[0] => stdClass Object ( [key] => FIRSTNAME [value] => Bill )
[1] => stdClass Object ( [key] => FULLNAME [value] => Bill Jones )
[2] => stdClass Object ( [key] => GENDER [value] => )
[3] => stdClass Object ( [key] => LASTNAME [value] => Jones )
[4] => stdClass Object ( [key] => LASTSUBSCRIBED [value] => 2019-12-20T21:13:20.359947Z )
[5] => stdClass Object ( [key] => POSTCODE [value] => )
[6] => stdClass Object ( [key] => THIS_KEY [value] => This Value )
)
[status] => Subscribed )
I have this JSON object and array in PHP that I have decoded.
I am trying to access 'This Value' but I am stuck.
I also need to find a way to do it where I don't know if it will always be number 6.
I have made these attempts:
$object->{"dataFields[1]"};
and
$object['dataFields'][6]['THIS_KEY'];
I can access the email like this:
echo $objec[1]->email;