Use output function to handle headers and json encoding
parent
6150f113c9
commit
e4763b3e0b
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
function output($data, $status_code = 200) {
|
||||
header('Content-Type: application/json');
|
||||
print json_encode($data);
|
||||
return http_response_code($status_code);
|
||||
}
|
Loading…
Reference in New Issue