array ( 'code' => $Ex->getCode(), 'message' => $Ex->getMessage(), ) ); } if( ! is_array($response) ){ throw new Exception('Ajax action did not return a response'); } // json ok $body = json_encode( $response ); header('Content-Type: application/json; charset=UTF-8', true ); header('Content-Length: '.strlen($body), true ); echo $body; exit(0); } catch( Exception $Ex ){ require dirname(__FILE__).'/loco-fatal.php'; }