我有一个error.php
附加的文件ErrorHandler
将HTTP错误状态作为GET变量.是否有一个我能找到的数组,它有一个状态代码到错误名称和描述的映射,或者我是否必须自己编写一个?
Svi*_*ack 42
关联数组版本
$http_codes = array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
103 => 'Checkpoint',
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
207 => 'Multi-Status',
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found',
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
306 => 'Switch Proxy',
307 => 'Temporary Redirect',
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required',
408 => 'Request Timeout',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed',
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Long',
415 => 'Unsupported Media Type',
416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed',
418 => 'I\'m a teapot',
422 => 'Unprocessable Entity',
423 => 'Locked',
424 => 'Failed Dependency',
425 => 'Unordered Collection',
426 => 'Upgrade Required',
449 => 'Retry With',
450 => 'Blocked by Windows Parental Controls',
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Timeout',
505 => 'HTTP Version Not Supported',
506 => 'Variant Also Negotiates',
507 => 'Insufficient Storage',
509 => 'Bandwidth Limit Exceeded',
510 => 'Not Extended'
);
Run Code Online (Sandbox Code Playgroud)
普通阵列版本
$http_codes = array(
array(100, 'Continue'),
array(101, 'Switching Protocols'),
array(102, 'Processing'),
array(103, 'Checkpoint'),
array(200, 'OK'),
array(201, 'Created'),
array(202, 'Accepted'),
array(203, 'Non-Authoritative Information'),
array(204, 'No Content'),
array(205, 'Reset Content'),
array(206, 'Partial Content'),
array(207, 'Multi-Status'),
array(300, 'Multiple Choices'),
array(301, 'Moved Permanently'),
array(302, 'Found'),
array(303, 'See Other'),
array(304, 'Not Modified'),
array(305, 'Use Proxy'),
array(306, 'Switch Proxy'),
array(307, 'Temporary Redirect'),
array(400, 'Bad Request'),
array(401, 'Unauthorized'),
array(402, 'Payment Required'),
array(403, 'Forbidden'),
array(404, 'Not Found'),
array(405, 'Method Not Allowed'),
array(406, 'Not Acceptable'),
array(407, 'Proxy Authentication Required'),
array(408, 'Request Timeout'),
array(409, 'Conflict'),
array(410, 'Gone'),
array(411, 'Length Required'),
array(412, 'Precondition Failed'),
array(413, 'Request Entity Too Large'),
array(414, 'Request-URI Too Long'),
array(415, 'Unsupported Media Type'),
array(416, 'Requested Range Not Satisfiable'),
array(417, 'Expectation Failed'),
array(418, 'I\'m a teapot'),
array(422, 'Unprocessable Entity'),
array(423, 'Locked'),
array(424, 'Failed Dependency'),
array(425, 'Unordered Collection'),
array(426, 'Upgrade Required'),
array(449, 'Retry With'),
array(450, 'Blocked by Windows Parental Controls'),
array(500, 'Internal Server Error'),
array(501, 'Not Implemented'),
array(502, 'Bad Gateway'),
array(503, 'Service Unavailable'),
array(504, 'Gateway Timeout'),
array(505, 'HTTP Version Not Supported'),
array(506, 'Variant Also Negotiates'),
array(507, 'Insufficient Storage'),
array(509, 'Bandwidth Limit Exceeded'),
array(510, 'Not Extended')
);
Run Code Online (Sandbox Code Playgroud)
你必须自己写这个.这很容易 - 使用http://bignosebird.com/apache/a5.shtml作为参考