Search code examples
phpjsonapifilehttp-status-codes

How to get the content of a json output


I have this json

Print_r($send);

    {"status":"INSUFFICIENT_APIBALANCE"}

and I have this

$send = var_dump(json_decode($send));

Now am trying to do this

   if ($send->status == "INSUFFICIENT_APIBALANCE"){

     echo "Recharge Now";
}else echo "testing";

But am not getting the expected result, please help


Solution

  • Remove var_dump():

    $send = json_decode($send);