true, ); $output = array_merge($output, $array); die(json_encode($output, $flags)); } public static function fail($array = []) { self::header(); $flags = PRODUCTION ? 0 : JSON_PRETTY_PRINT; $output = array( "success" => false ); if(is_string($array)) { $array = [ "message" => $array, ]; } $output = array_merge($output, $array); die(json_encode($output, $flags)); } }