- property_exists: documentation ( source)
- var_dump: documentation ( source)
<?php
$obj1 = new stdClass();
$obj1->permission = "public_profile";
$obj1->status = "granted";
$obj2 = new stdClass();
$obj2->permission = "email";
$obj2->status = "granted";
$arrayResult = array($obj1, $obj2);
var_dump($arrayResult);
foreach($arrayResult as $key => $obj){
if(property_exists($obj, "email")){
echo "\$arrayResult[$key]->email exists\n";
}
}