how can I access the values in a nested array, e.g. when using get for contact entity e.g. how can I adjust the following to get the first name? (not working for me at the moment)
$result = civicrm_api3('Contact', 'get', array(
'sequential' => 1,
'return' => array("first_name", "last_name", "email"),
'id' => 28296
));
echo $result['values'][0]['first_name'];
if I use var_dump ($result) I get the following so the results are there:
array(5) { ["is_error"]=> int(0) ["version"]=> int(3) ["count"]=> int(1) ["id"]=> int(28296) ["values"]=> array(1) { [0]=> array(6) { ["contact_id"]=> string(5) "28296" ["first_name"]=> string(8) "Thirteen" ["last_name"]=> string(4) "Test" ["email_id"]=> string(5) "27750" ["email"]=> string(25) "[email protected]" ["id"]=> string(5) "28296" } } }
thanks much!