I\'m using PHP to process input from an AJAX form. I have written an error handler function to make sure the response is always valid JSON, and it\'s been working fine so far.