diff options
Diffstat (limited to 'includes')
| -rw-r--r-- | includes/functions.php | 14 | 
1 files changed, 14 insertions, 0 deletions
diff --git a/includes/functions.php b/includes/functions.php new file mode 100644 index 0000000..b5208e6 --- /dev/null +++ b/includes/functions.php @@ -0,0 +1,14 @@ +<?php declare(strict_types=1); + +function respondAndExit(int $responseCode, string $header, array $headers = []): void +{ +    header($header, false, $responseCode); + +    foreach ($headers as $header) { +        header($header); +    } + +    header('Content-type: text/plain; charset=UTF-8'); + +    exit(); +}  | 
