I have a JSON response, and I have tried many means to extract the value that has (APPROVED), but it is difficult
Here is the Response:
PHP, JSON
2028000NGNDepositSecure3D{"lkpTransactionId":"1100037249","lkpErrorNo":"0","lkpErrorDescription":"Approved","lkpEnrolled":"Y","lkpEciFlag":"02","authSend":"Y","authErrorNo":"0","authErrorDescription":"Approved","authCavv":"jHyn+7YFi1EUAREAAAAvNUe6Hv8=","authXid":"O0KGgwbJpRpdB8cw4OUfee34PkA=","authEciFlag":"02","authPAResStatus":"Y"}Successful64086914117475714319752028000052019545301******41541100037249MASTERCARDSamuel Adah00SuccessfultrueSUCCESSFULPAYMENT
I would like to get each results in an array or string.
THank you guys.
UPDATE:
I was able to follow your suggestion and I am left with the following results:
array(12) {
["lkpTransactionId"]=>
string(10) "1100037249"
["lkpErrorNo"]=>
string(1) "0"
["lkpErrorDescription"]=>
string(8) "Approved"
["lkpEnrolled"]=>
string(1) "Y"
["lkpEciFlag"]=>
string(2) "02"
["authSend"]=>
string(1) "Y"
["authErrorNo"]=>
string(1) "0"
["authErrorDescription"]=>
string(8) "Approved"
["authCavv"]=>
string(28) "jHyn+7YFi1EUAREAAAAvNUe6Hv8="
["authXid"]=>
string(28) "O0KGgwbJpRpdB8cw4OUfee34PkA="
["authEciFlag"]=>
string(2) "02"
["authPAResStatus"]=>
string(1) "Y"
}
Getting value of authErrorDescription is really difficult for me.
I tried this:
foreach($res as $user){
echo $user[8]['authErrorDescription'].'<br/>';
//echo $user[0]->authErrorDescription;
}
But result did not show properly.