e949/api/_json.php

24 lines
379 B
PHP
Raw Normal View History

2023-08-12 04:09:17 +05:30
<?php
require_once("_errors.php");
2023-08-12 04:09:17 +05:30
function ReturnJSONData ($arr) {
$data = json_encode($arr);
if (!$data) {
$data = json_encode(array("error" => $Err_Int_JSONEncode));
2023-08-12 04:09:17 +05:30
}
header("Content-Type: application/json; charset=utf-8");
echo $data;
exit;
}
function ReturnJSONError ($err, $desc) {
ReturnJSONData(array(
"error" => $err,
"description" => $desc
));
}
?>