When the CURL response is returned in format like below.
Array
(
[timestamp] => 20150409065254
[callback_status_code] => 200
[fingerprint] => 252839e4790446a4bdd3a353aa232281a7a0b464
[txnid] => 219773
[merchant] => ABC0001
[restext] => Approved
[rescode] => 00
[expirydate] => 052016
[settdate] => 20150409
[refid] => t1
[pan] => 444433...111
[summarycode] => 1
)
is there any way to access its data as array. Its just in array format not array
I'm using following code.
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
);
$param = http_build_query($data);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$param);
curl_setopt_array($ch, $options);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
$content = curl_exec($ch);
$status = curl_getinfo($ch);
curl_close($ch);
echo $content;
Any help guys ???
json_encode(). Then, when you get the data, usejson_decode($response, true);print_r(). It's designed to be human-readable, but it's not possible to parse it reliably.print_r) than a usable response.