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]);
}
?>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号