Reputation: 385
I have an api wrapper i am using that returns something like this
object(stdClass)#7 (1) {
[0]=>
object(stdClass)#6 (2) {
["contactId"]=>
string(2) "nV"
["email"]=>
string(31) "[email protected]"
}
}
how do i access the email part with PHP
Upvotes: 0
Views: 50
Reputation: 3157
Cast your API returned data to an array.
For example you are saving API returned data in $result
variable. Cast it to an array.
$arrayResult = (array) $result;
echo $arrayResult[0]->email;
Try this.
Upvotes: 2