Added some base methods (utils)

This commit is contained in:
Bofh 2021-11-25 20:00:18 +01:00
parent b889e008a4
commit 0b28014597
1 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,15 @@
<?php
function get_request_json() {
return @json_decode(file_get_contents('php://input'));
}
function unquote($text) {
$text = str_replace("'", "", $text);
$text = str_replace('"', '', $text);
return $text;
}
# HTTP result => JSON
function hres_json($code, $status, $message) {
header('Content-Type: application/json');