I am trying to extract a custom field from a contact record. The API returns an array of the following form:
Array (
[0] => 0
[1] => 3
[2] => array (
[0] => array (
[value 1] => 123
[value 2] => 456
[value 3] => 789
)))
Using php how can I extract value 1, 2 or 3?
Later information
This is the actual array
Array (
[0] => 0
[1] => 3
[2] => 1
[3] => 2911
[4] => Array (
[0] => Array (
[contact_id] => 2911
[civicrm_value_aru_data_1_id] => 2586
[custom_64] => 2014848
[id] => 2911
)))
and I want to extract the value of custom_64. I am using:
$rugby_id = $arrayvariable[4][0][custom_64];
which returns nothing and I can't see where I am going wrong.
Even later information
I am still struggling with this issue. In an attempt to simplify things I have changed the CiviCRM API call to 'getsingle' and stored the result as follows:
$results = print_r($result, true);
echo $results;
which leads to the following:
Array (
[contact_id] => 2911
[civicrm_value_aru_data_1_id] => 2586
[custom_64] => 2014848
[id] => 2911
)
If I now try to extract the value of custom_64 using:
$rugby_id = $results['custom_64'];
The value returned is 'A'. I have researched this to death but have not found the cause of the problem.