php - getting value of element in json response -


my json response getting

$str = '{"refund_order_result":{"reason":"","refund_status":0}} '; $refoutput = json_decode($str,true);  print $refoutput->refund_order_result->refund_status; 

i want value of refund_status unable . way values

echo "<pre>";print_r($refoutput);//see array use below code echo $refoutput['refund_order_result']['refund_status']; 

or

$refoutput = json_decode($str);//remove true wil return object echo $refoutput->refund_order_result->refund_status; 

note : when true, returned objects converted associative arrays.

you have used true getting array not object


Comments