这是我的单长度数组
array(1) { ["http://abc_cde_com/riseres_php?TransactionID=2517055&Amount=1_00&AuthorizationCode=MB0118&ResultID=0&ResultMessage=APPROVED_OR_COMPLETED_SUCCESSFULLY_&ResponseCode=00&ResponseMessage=OPERATION_IS_APPROVED_(SIM)&HostResponseMsg=OPERATION_IS_APPROVED_(SIM)&ReferenceNumber=XYZ123&3DProvider=___"] => string(0) "" }
如何从上面的数组和其他数组中获取TransactionID和ReferenceNumber?
答案 0 :(得分:0)
使用parse_url
和parse_str
将$ _GET参数转换为assoc数组。像这样(假设你的数组被称为$input
)
$parsed = parse_url(current($input));
parse_str($parsed['query'], $params);
$transactionID = $params['TransactionID'];
$referenceNumber = $params['ReferenceNumber']