我正在查询的 API 返回以下数据,我使用 json_decode 将其放入数组中。我需要提取某些值以插入 MySQL 数据库。在下面的示例中(只有一个 ID),我想插入 ID = 4229850 和 2011(字段 Vanguard 的值)。我不知道如何在数组中导航并生成适当的插入语句。
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
)
)
)
)
)