json_encode. Workaround for PHP < 5.1.6