CoinGate\Merchant\Order Object
(
[order:CoinGate\Merchant\Order:private] => Array
(
[id] => 97977
[status] => new
[do_not_convert] =>
[price_currency] => USD
[price_amount] => 1200.0
[lightning_network] =>
[receive_currency] => EUR
[receive_amount] =>
[created_at] => 2018-07-03T05:53:43+00:00
[order_id] => 459469
[payment_url] => https://sandbox.coingate.com/invoice/94423345-1a1a-4895-a08e-98793777b0d0
[token] => x5Yrx5mmku8nkyK2ShVvbCuiJfasoxsNBtxZ27Ra
)
)
这是请求的响应,但我正面临着从此类数组获取值的问题。我需要从此类数组中获取payment_url。
答案 0 :(得分:1)
在Order.php
文件中,有一种神奇的style="?android:progressBarStyleHorizontal"
方法。因此,您应该使用它来获取所需的属性:
__get
答案 1 :(得分:0)
get_object_vars函数将对象转换为数组。考虑到您在变量$x
中具有此对象,那么您应该这样做:
$y = get_object_vars($x);
echo $y['payment_url'];