php
/**
* http protocol defined status codes
* http协议状态码,调用函数时候只需要将$num赋予一个下表中的已知值就直接会返回状态了。
* @param int $num
* downloads by http://www.bkjia.com
*/
function https($num) {
$http = array (
100 => "http/1.1 100 continue",
101 => "http/1.1 101 switching protocols",
200 => "http/1.1 200 ok",
201 => "http/1.1 201 created",
202 => "http/1.1 202 accepted",
203 => "http/1.1 203 non-authoritative information",
204 => "http/1.1 204 no content",
205 => "http/1.1 205 reset content",
206 => "http/1.1 206 partial content",
300 => "http/1.1 300 multiple choices",
301 => "http/1.1 301 moved permanently",
302 => "http/1.1 302 found",
303 => "http/1.1 303 see other",
304 => "http/1.1 304 not modified",
305 => "http/1.1 305 use proxy",
307 => "http/1.1 307 temporary redirect",
400 => "http/1.1 400 bad request",
401 => "http/1.1 401 unauthorized",
402 => "http/1.1 402 payment required",
403 => "http/1.1 403 forbidden",
404 => "http/1.1 404 not found",
405 => "http/1.1 405 method not allowed",
406 => "http/1.1 406 not acceptable",
407 => "http/1.1 407 proxy authentication required",
408 => "http/1.1 408 request time-out",
409 => "http/1.1 409 conflict",
410 => "http/1.1 410 gone",
411 => "http/1.1 411 length required",
412 => "http/1.1 412 precondition failed",
413 => "http/1.1 413 request entity too large",
414 => "http/1.1 414 request-uri too large",
415 => "http/1.1 415 unsupported media type",
416 => "http/1.1 416 requested range not satisfiable",
417 => "http/1.1 417 expectation failed",
500 => "http/1.1 500 internal server error",
501 => "http/1.1 501 not implemented",
502 => "http/1.1 502 bad gateway",
503 => "http/1.1 503 service unavailable",
504 => "http/1.1 504 gateway time-out"
);
header($http[$num]);
}
?>
0
0
相关文章
如何在多语言环境下实现自然排序(如土耳其语)?
如何调试 Phalcon PHP 中的 JOIN 查询无返回结果问题
MySQL UPDATE 语句末尾多余逗号导致 PDO 语法错误的修复方法
如何在 PHP 中实现土耳其语等多语言的自然排序
如何在不刷新页面的情况下安全地通过服务端会话信息更新数据库
相关标签:
本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门AI工具









