1
0
Fork 0
mirror of https://github.com/Alamantus/Lexiconga.git synced 2025-06-07 01:36:37 +02:00
Lexiconga/backend/Response.php

14 lines
380 B
PHP
Raw Normal View History

2017-12-24 12:00:45 -07:00
<?php
class Response {
public static function json ($data, $http_code = 200) {
header('Content-Type: application/json; charset=utf-8');
2017-12-24 12:00:45 -07:00
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;
2017-12-24 12:00:45 -07:00
}
}