Possible Duplicate:
Parse Json in php
I am working with an API that sends a POST request to my PHP script when a user performs an action. I can easily log the raw POST data to a file, for example:
$rawPostData = file_get_contents('php://input');
$all = date("F j, Y, g:i a") . " " . $rawPostData . "\r\n";
file_put_contents("Activity.log", $all, FILE_APPEND);
Writes this to the log file:
October 1, 2012, 12:34 pm [{"changed_aspect": "media", "subscription_id": 2421759, "object": "user", "object_id": "931456", "time": 1349120084}]
The only thing I am interested in is the object_id value. How can I access this value in the raw POST data? I've tried a ton and searched a number of forums for a solution. It seems simple enough but I can't seem to get it. Any ideas?