summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/DTS/Functions.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/DTS/Functions.php b/src/DTS/Functions.php
new file mode 100644
index 0000000..b7f9cb3
--- /dev/null
+++ b/src/DTS/Functions.php
@@ -0,0 +1,18 @@
+<?php
+
+declare(strict_types=1);
+
+namespace DTS\Functions;
+
+function respondAndExit(int $responseCode, string $header, string $body, array $headers = []): void
+{
+ header($header, false, $responseCode);
+
+ foreach ($headers as $header) {
+ header($header);
+ }
+
+ echo $body;
+
+ exit();
+}