e949/api/_json.php
2023-08-12 01:39:17 +03:00

22 lines
382 B
PHP

<?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
));
}
?>