-1
我使用GET請求連接到API。當我在JSON數組中使用var_dump
時,我得到了完整的數組,並且我只想得到一些像「email」這樣的值。如何在PHP中回顯一個數組的變量?
這是響應:
{
["communication"]=> array(12) {
["@id"]=> string(8) "84730060"
["@uri"]=> string(63) "https://gethope.fellowshiponeapi.com/v1/Communications/84730060"
["household"]=> array(2) {
["@id"]=> string(8) "46312207"
["@uri"]=> string(59) "https://gethope.fellowshiponeapi.com/v1/Households/46312207"
}
["person"]=> array(2) {
["@id"]=> string(8) "75977434"
["@uri"]=> string(55) "https://gethope.fellowshiponeapi.com/v1/People/75977434"
}
["communicationType"]=> array(3) {
["@id"]=> string(1) "4"
["@uri"]=> string(75) "https://gethope.fellowshiponeapi.com/v1/Communications/CommunicationTypes/4"
["name"]=> string(5) "Email"
}
["communicationGeneralType"]=> string(5) "Email"
["communicationValue"]=> string(19) "[email protected]"
["searchCommunicationValue"]=> string(19) "[email protected]"
["preferred"]=> string(4) "true"
["communicationComment"]=> NULL
["createdDate"]=> string(19) "2015-11-17T13:30:24"
["lastUpdatedDate"]=> string(19) "2016-02-02T14:08:22"
}
}
請更正你的代碼。你有一條正確的路徑,它不等於echo語句之前的任何東西,並且在你的解釋中有更多的錯誤。 – Webeng
你能清楚你所期望的是什麼嗎? –