Created
September 16, 2015 00:23
-
-
Save gnrfan/1fb3d063cb16ba9c8563 to your computer and use it in GitHub Desktop.
Custom Status Code in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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