This commit is contained in:
2023-08-12 01:39:17 +03:00
parent e92f792640
commit 79a031401a
13 changed files with 127 additions and 8 deletions

22
api/_json.php Normal file
View File

@ -0,0 +1,22 @@
<?php
require_once("_errors.php");
function ReturnJSONData ($arr) {
$data = json_encode($arr);
if (!$data) {
$data = json_encode(array("error" => $Err_Int_JSONEncodeError));
}
header("Content-Type: application/json; charset=utf-8");
echo $data;
exit;
}
function ReturnJSONError ($err, $desc) {
ReturnJSONData(array(
"error" => $err,
"description" => $desc
));
}
?>