Handling JSON like a boss in PHP