I have the following string that corresponds to a JSON object.
$string = '{"status": "success", "count": 3, "data": [{"id": 112233}]}'
And I would like to cast it to a stdClass
. My current solution:
$object = (object)(array)json_decode($string);
While this is functioning, is there a better way? This seems messy and inefficient.