Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/239.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP易趣API对象值_Php_Ebay Api - Fatal编程技术网

PHP易趣API对象值

PHP易趣API对象值,php,ebay-api,Php,Ebay Api,我正在使用eBay API,并使用GetSingleItem检索eBay项目数据。从这些数据中,我想从返回的对象中提取价格: DTS\eBaySDK\Shopping\Types\AmountType Object ( [values:DTS\eBaySDK\Types\BaseType:private] => Array ( [currencyI

我正在使用eBay API,并使用GetSingleItem检索eBay项目数据。从这些数据中,我想从返回的对象中提取价格:

DTS\eBaySDK\Shopping\Types\AmountType Object
            (
                [values:DTS\eBaySDK\Types\BaseType:private] => Array
                    (
                        [currencyID] => USD
                        [value] => 19.99
                    )

                [attachment:DTS\eBaySDK\Types\BaseType:private] => Array
                    (
                        [data] =>
                        [mimeType] =>
                    )

            )
我尝试过将对象转换为数组,我尝试过使用obj->values->value。
如何从值数组中检索价格数据(19.99)?

您可能需要执行
$item->CurrentPrice->value
。例如:


$response=$service->getSingleItem($request);
$item=$response->item;
$item->CurrentPrice->value;


以防您不知道存在。

您可能需要执行
$item->CurrentPrice->value
。例如:


$response=$service->getSingleItem($request);
$item=$response->item;
$item->CurrentPrice->value;


以防您不知道有一个。

我的错误是使用大写V表示值,而不是您所说的$item->CurrentPrice->value。谢谢您的帮助。我的错误是使用大写V表示值,而不是您所说的$item->CurrentPrice->value。谢谢你的帮助。