I do have following associative multidimensional array available after json_decode(string, true).
Array
(
[statusCode] => 200
[data] => Array
(
[objects] => Array
(
[0] => deals
[1] => contacts
[2] => accounts
)
[deals] => Array
(
[0] => dealName
[1] => ApprovedBy
[2] => ApprovedDate
[3] => CloseDate
)
[contacts] => Array
(
[0] => contectName
[1] => email
[2] => firstName
[3] => lastName
)
[accounts] => Array
(
[0] => accountName
[1] => creationDate
[2] => ApprovedDate
[3] => accountNumber
)
)
)
It want to replace numeric keys with their corresponding values in arrays like:
[deals] => deals
[contacts] => contacts
[accounts] => accounts
What I tried so far?
$finalIOArray = array();
$integrationObjectsArray = $response['data']['objects'];
foreach($integrationObjectsArray as $integrationObject){
$finalIOArray[$integrationObject] = $integrationObject;
}
This is for only the objects array in the main data array. But I want to replace keys with values in all the sub-arrays in the main data array.
objectsentry at all; it is duplicate information for what is already represented by the other keys in the same array. Also I don't understand whydeals,contactsandaccountsare plural words when you only store one item in their values.