我有一個連接到facebok sdk的函數。PHP找到數組並將其轉換爲變量
此函數回退下面發佈的數組。
我想在該數組和子數組中找到一個特定的變量,並將其存儲到MySQL中。
我需要搜索此索引:[name] => Riad Flam and all sub (ex toke,id,...)
並將其存儲到MySQL中。
這是返回數組:
Array
(
[data] => Array
(
[0] => Array
(
[category] => Local business
[category_list] => Array
(
[0] => Array
(
[id] => 164243073639257
[name] => Hotel
)
)
[name] => Riad Flam
[access_token] => BAAGeBYlwA38BALZAddqsUR2na13zh40E1F7YQMKGiga6fVIzkqBt3RW5r5vTIl3Qnb8lLhZBMk8yNAcRZCp8FDpgGr4ZCagHU1yqJ1w2oUklgAwlZAgJotHYZCJQcw2g1H5uZCdtdhcLwGwLZA2FfEFRGBUgUKvs2a1LJIDFab3vXoS1srbqnZA1cztIH5iyqZB7dEGEXxNEPzMdcvGZCZAw8nuWZCECwkE2WAy0ZD
[id] => 124602074303943
[perms] => Array
(
[0] => ADMINISTER
[1] => EDIT_PROFILE
[2] => CREATE_CONTENT
[3] => MODERATE_CONTENT
[4] => CREATE_ADS
[5] => BASIC_ADMIN
)
)
[1] => Array
(
[category] => Energy/utility
[name] => Ewaa
[access_token] => BAAGeBYlwA38BAFWlnftqfUpM0nT3i9OG6BxDHhcoVQEZAsPciUce4zZA2ywWX6LrzlLMXZA24wBRHmG60wZCYSEG0J9kdPTAUnQD9kLMgdDYup1ZBJcji4mzCS2ltJmpGbBCsglcZBwjix8Vl5bhUrOu3o1hZBA6SBsOE9ZC1SZAeJZANdvA0OV2myj4yYEcVvZBinyyzGUhRH3TtYWEb4zfmFfaZAyau9Np2agZD
[id] => 239767479474629
[perms] => Array
(
[0] => ADMINISTER
[1] => EDIT_PROFILE
[2] => CREATE_CONTENT
[3] => MODERATE_CONTENT
[4] => CREATE_ADS
[5] => BASIC_ADMIN
)
)
的foreach()和字符串比較? – 2013-04-24 15:12:48
@RoyalBg:給U男人的帽子......!你理解這個問題嗎? – 2013-04-24 15:14:13
是的,但第二個想法,也許不是,所以,他想從這個'name'所在的同一個鍵檢索數據? – 2013-04-24 15:22:08