Skip to content

Instantly share code, notes, and snippets.

@gnrfan
Created September 16, 2015 00:23
Show Gist options
  • Save gnrfan/1fb3d063cb16ba9c8563 to your computer and use it in GitHub Desktop.
Save gnrfan/1fb3d063cb16ba9c8563 to your computer and use it in GitHub Desktop.
Custom Status Code in PHP
<?php
// Works in PHP 5.3
header("Content-Type: application/json", true, 500);
$doc = array(
"status" => "error",
"message" => "El correo no se pudo enviar"
);
echo json_encode($doc, JSON_PRETTY_PRINT);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment