1
0
Fork 0
mirror of https://github.com/Alamantus/Lexiconga.git synced 2025-05-11 12:41:45 +02:00
Lexiconga/backend/Response.php

14 lines
No EOL
380 B
PHP

<?php
class Response {
public static function json ($data, $http_code = 200) {
header('Content-Type: application/json; charset=utf-8');
http_response_code($http_code);
echo json_encode($data);
}
public static function html ($html, $http_code = 200) {
header('Content-Type: text/html; charset=utf-8');
http_response_code($http_code);
echo $html;
}
}