-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
你能清楚你所期望的是什么吗? –