用 PHP 解析网络资源响应

问题描述

我需要解析下面的数组并检索值;状态,id。

下面是 PHP 数组

Array ( [0] => CyberSource\Model\PtsV2PaymentsPost201Response Object ( [container:protected] => 
Array ( [links] => CyberSource\Model\PtsV2PaymentsPost201ResponseLinks Object ( [container:protected] => 
    Array ( [self] => CyberSource\Model\PtsV2PaymentsPost201ResponseLinksSelf 
        Object ( [container:protected] => Array ( [href] => /pts/v2/payments/621258854395 [method] => GET ) )
        [reversal] => [capture] => [customer] => [paymentInstrument] => [shippingAddress] => [instrumentIdentifier] => ) ) 
        [id] => 621258854395 
        [submitTimeUtc] => 2021-05-17T13:40:55Z 
        [status] => AUTHORIZED 
        [reconciliationId] => 621258854395 
        [errorinformation] =>...............

下面是我的PHP代码

 $parseApiResponse = new CyberSource\Model\PtsV2PaymentsPost201Response($apiResponse);
    print_r("Status"." ".$parseApiResponse->getStatus()); 

请协助解决此问题。

要做类似的事情,就像我在 Java 中能够做的一样

  String status = result.getStatus();

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)