An API I am querying returns the following data which I've used json_decode to put into an array. I need to extract certain values for inserting into a MySQL database. In the example below (which only has one ID), I want to insert ID = 4229850 and 2011 (the value of the field Vanguard). I'm can't figure out how to navigate through the array and generate the appropriate insert statement.
Array
(
[Contacts] => Array
(
[0] => Array
(
[Id] => 4229850 [Url] => https://abc.com
[FirstName] => Mol
[LastName] => Thompson
[FieldValues] => Array
(
[0] => Array
(
[FieldName] => Profile last updated [Value] =>
)
[1] => Array
(
[FieldName] => First name [Value] => Mol
[CustomAccessLevel] => Public
)
[2] => Array
(
[FieldName] => Last name [Value] => Thompson
)
[3] => Array
(
[FieldName] => e-Mail [Value] => abc@yahoo.ca
)
[4] => Array
(
[FieldName] => Vanguard [Value] => 2011
)
)
)
)
)