$postdata= "stdClass Object
(
[created] => 1326853478
[livemode] =>
[id] => evt_00000000000000
[type] => invoice.payment_succeeded
...........................
))";
$event = json_decode($postdata);
echo "<pre>";
print_r($event);
Can't std class object to array in php?I am using json_decode but its not working just get empty array.I am giving my result data std class object assign in variable its anything wrong that's why its showing not working?
var_dumpO_o$postdatais not an object in this case, it is a string. This string is also not valid JSON. If it was an object you could simply do$event = (array) $postData. Is there a reason you have it this way?stdClassoutput from aprint_r()or something