# How to get usable values from $contact

**URL:** <https://forum.mautic.org/t/how-to-get-usable-values-from-contact/21011>\
**Category:** Development\
**Created:** [September 25, 2021, 1:07pm UTC](https://forum.mautic.org/t/how-to-get-usable-values-from-contact/21011 "2021-09-25T13:07:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![modifiedcontent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/modifiedcontent/32/511_2.png) [@modifiedcontent](https://forum.mautic.org/u/modifiedcontent)\
**Post date:** [September 25, 2021, 1:07pm UTC](https://forum.mautic.org/t/how-to-get-usable-values-from-contact/21011/1 "2021-09-25T13:07:35Z")

</div>

How can I get usable values from Mautic objects like [$contact](https://github.com/mautic/developer-documentation/blob/d96d963b62cef0b887a36855f7a7541d30004135/source/includes/_api_endpoint_contacts.md)?

> $contact = $contactApi-\>get($id);

$contact is some kind of complicated multidimensional (?) array that contains a lot of information. What is the quickest, most efficient way to get useful bits like ‘firstname’ or ‘email’ from it?

**Edit:**

You can narrow it down with this:

> $fields = array\_column($contact, ‘fields’);  
> $core = array\_column($fields, ‘core’);  
> $firstname = array\_column($core, ‘firstname’);

This then gives me the contact’s first name:

> echo $firstname[0][‘value’];

So that’s the solution I guess. Or is this the wrong approach? Is there a more efficient way? Or a built-in Mautic solution I missed?
