summaryrefslogtreecommitdiff
path: root/lib/utils.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-08-15 22:41:54 +0500
committerilotterytea <iltsu@alright.party>2025-08-15 22:41:54 +0500
commit0d7ecc616d669f824f8416b47a0a986b46fa579b (patch)
tree4c5143d404e272f341876945bed7f42dc7d75238 /lib/utils.php
parente971d763cb649a51d26f75e8764ffbcb2d9d7a2b (diff)
feat: registration page
Diffstat (limited to 'lib/utils.php')
-rw-r--r--lib/utils.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/utils.php b/lib/utils.php
new file mode 100644
index 0000000..b81ddda
--- /dev/null
+++ b/lib/utils.php
@@ -0,0 +1,11 @@
+<?php
+function json_response(int $code, string|null $message, mixed $data)
+{
+ header('Content-Type: application/json');
+ http_response_code($code);
+ return json_encode([
+ 'status_code' => $code,
+ 'message' => $message,
+ 'data' => $data
+ ], JSON_UNESCAPED_SLASHES);
+} \ No newline at end of file