sneha
December 11, 2019, 10:14am
1
I have received data from request method. Now, how can i access data that is separated using ‘|’. Can anyone help please??
This is the url:-
https://myproject/controller/response/?MerchantCode=T86422|Status=P|Desc=Pending|MerchantTxnRefNumber=TNX121995|BankCode=NA
I want to access data as
Merchantcode=T86422;
Status= P; and so on…
Hi,
Who send request, you can tell to them => to pass query string like this https://myproject/controller/response/?MerchantCode=T86422&Status=P&Desc=Pending&MerchantTxnRefNumber=TNX121995&BankCode=NA
sneha
December 11, 2019, 10:31am
3
Its a third party response. I have to decode it with my code. Any help??
You Can try like this
$parts = parse_url(“https://myproject/controller/response/?MerchantCode=T86422|Status=P|Desc=Pending|MerchantTxnRefNumber=TNX121995|BankCode=NA ”);
echo “
”;
print_r($parts[‘query’]);
$values = explode("|", $parts[‘query’]);
echo “”;
print_r($values);
exit;