如何解决PHP SLIM API 处理@attributes
我试图从另一个我无法控制的 API 中读取值。
api 以这种格式向下推送数据:
array(1) {
["@attributes"]=>
array(3) {
["height"]=>
string(3) "768"
["id"]=>
string(3) "492"
["width"]=>
string(3) "576"
}
}
我正在尝试访问 API 中的值,例如高度、ID、宽度,如下所示:
$value["@attributes"]["id"]
我在尝试通过另一个超薄 2.4.2 API 推送数据时遇到以下错误:
Slim Application Error
The application could not run because of the following error:
Details
Type: ErrorException
Code: 8
Message: Undefined index: @attributes
File: /home/api.php
Line: 71
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。