Skip to content

Instantly share code, notes, and snippets.

@anthonycvella
Last active December 12, 2015 00:49
Show Gist options
  • Save anthonycvella/4686899 to your computer and use it in GitHub Desktop.
Save anthonycvella/4686899 to your computer and use it in GitHub Desktop.
function sendResponse($status, $body = '')
{
$status_header = 'HTTP/1.1 ' . $status;
header($status_header);
header('Content-type: application/json');
echo $body;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment