What's going on here? Why not put all this into a an array and the use encode_json to output the string?