I tried using json_encode but the result ends up something similar to array not in json format can any one help me in forming the json object pls. im getting the array from an url i need to convert it to json directly
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $Url);
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $qs);
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
$array = curl_exec($c);
this is the array i get from printing the url
Array(
[status] => 1
[msg] => 2 vo settled on 2015-05-07
[Vo_details] => Array
(
[0] => Array
(
[void] => 12sd
[vdate] => 2015-05-07 13:04:11
[mode] => DD
[amount] => 10.00
[bank_name] => DD
[issuing_bank] => abc
)
[1] => Array
(
[void] => 12a
[vdate] => 2015-05-07 15:10:18
[mode] => DD
[amount] => 10.00
[bank_name] => EE
[issuing_bank] => abc
)
))
if i use json_encode im getting something like this
Array\n(\n [status] => 1\n [msg] => 2 vo settled on 2015-05-07\n [Vo_details] => Array\n (\n [0] => Array\n (\n [void] => 12sd\n [vdate] => 2015-05-07 13:04:11\n [mode] => DD\n [amount] => 10.00\n [bank_name] => DD\n [issuing_bank] => abc\n )\n\n [1] => Array\n (\n [void] => 12a\n [void] => 2015-05-07 15:10:18\n [mode] => DD\n [amount] => 10.00\n [bank_name] => EE\n [issuing_bank] => abc\n )\n )\n\n)\n</pre>"