diff options
| author | winter | 2024-12-06 20:43:26 +0000 |
|---|---|---|
| committer | winter | 2024-12-06 20:43:26 +0000 |
| commit | e1ad307b531c27ec6bfaf8b4d018991b0d4a78f3 (patch) | |
| tree | 4ef08af2b4051d433bb929d5162474ac6777cab1 /misc/json_response.php | |
initial commit
hardcoded functionality mostly!
Diffstat (limited to 'misc/json_response.php')
| -rw-r--r-- | misc/json_response.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/misc/json_response.php b/misc/json_response.php new file mode 100644 index 0000000..4244b64 --- /dev/null +++ b/misc/json_response.php @@ -0,0 +1,11 @@ +<?php + +function json_response( + mixed $value, + string $contentType = 'application/json', + int $flags = 0, + int $depth = 512 +) { + header("Content-Type: $contentType"); + echo json_encode($value, $flags, $depth); +}
\ No newline at end of file |
