found it: http://nitschinger.at/Handling-JSON-like-a-boss-in-PHP