my json response i am getting
$str = '{"Refund_Order_Result":{"reason":"","refund_status":0}} ';
$refoutput = json_decode($str,true);
print $refoutput->Refund_Order_Result->refund_status;
i want to get value of refund_status unable to do that . any way to get values
$refoutput['Refund_Order_Result']['refund_status'];
try this
$refoutput = json_decode($str,true);
the above variable will give an array, so u have to use code like given below...
$refoutput['Refund_Order_Result']['refund_status']
echo "<pre>";print_r($refoutput);//see this is an array so use below code
echo $refoutput['Refund_Order_Result']['refund_status'];
or
$refoutput = json_decode($str);//remove true this wil return object
echo $refoutput->Refund_Order_Result->refund_status;
Note : When TRUE
, returned objects
will be converted into associative arrays.
You have used true so you are getting array
not object