PHP Function of the Day (2011-9-21): json_encode

Do a lot of javascript? Well eventually you’ll run into [fphp]json_encode[/fphp] and its inverse, [fphp]json_decode[/fphp]. The function takes any PHP object or array and encodes it as a javascript object. This simplifies the transfer of data between server and client sides of an application.