i have a response encoded in JSON. Stored in a variable and trying to decode. But it not displaying any thing. code is here
echo $response; //prints response like
({ "OrderStatus" : "REJECT", "OrderID" : "","PONumber" :"", "Reject Reason" : "INVALID_FLD_VALUE You have entered an Invalid Field Value 41111 for the following field: ccnumber", "AUTHCODE" : "", "ShippingCost" : "", "HandlingCost" : ""});
//Trimming braces etc
$routes = ltrim($response, '('); //left trim
$routes_comp= rtrim($routes, ');'); //right trim
echo "<br/>";
echo $routes_comp;
//decoding here
$jsoni=json_decode($routes_comp);
$var= $jsoni->OrderStatus;
print_r($var);
exit;
i want order status value but its not displaying any thing.what is the actual way?.
print_r($jsoni);?