我有一个如下所示的数组:
Array (
[TIMESTAMP] => 2012-01-04T21:36:32Z
[CORRELATIONID] => 4564e64d7f75f
[ACK] => Failure
[VERSION] => 51.0
[BUILD] => 2278658
[L_ERRORCODE0] => 10764
[L_SHORTMESSAGE0] => This transaction cannot be processed at this time. Please try again later.
[L_LONGMESSAGE0] => This transaction cannot be processed at this time. Please try again later.
[L_SEVERITYCODE0] => Error
[L_ERRORPARAMID0] => ProcessorResponse
[L_ERRORPARAMVALUE0] => PPAV
[AMT] => 25.00
[CURRENCYCODE] => USD
[AVSCODE] => N
[CVV2MATCH] => M
)
如果我想回显 [L_LONGMESSAGE0] 的值(即“此时无法处理此事务。请稍后再试”),我将如何使用 php 执行此操作?
更清楚地说,当我使用此命令时,我从 PayPal 获取了这个数组: urldecode(print_r($httpParsedResponseAr, true))
那么,如果该命令生成上面显示的数组,我将如何回显 [L_LONGMESSAGE0]?
预先感谢您的帮助
最佳答案
假设这个数组在一个$arr
变量中。
echo $arr['L_LONGMESSAGE0'];
关于php - 使用 php 从数组中提取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8734659/