Just found in CodeProject sent me an article called: the shortest PHP code for returning HTTP Response code The translation is (PHP shortest HTTP response code) the author used 13 examples to find the shortest HTTP response code, of which five is not successful, the following is what I cut in this article:
Header("http/1.1 404");//WorksHeader("HTTP/1 404");//WorksHeader("http/404");//WorksHeader("HTTP 404");//doesn ' t work, returns OKHeader("http/1.1", 0,404);//doesn ' t work, returns OKHeader("HTTP/1", 0,404);//doesn ' t work, returns OKHeader("http/", 0,404);//doesn ' t work, returns OKHeader("HTTP", 0,404);//WorksHeader("", 0,404);//doesn ' t work, returns OKHeader("/", 0,404);//WorksHeader("1", 0,404);//WorksHeader(1,0,404);//WorksHeader(0,0,404);//Works
So shortest Code is:
Header (0,0,404);
PHP's Shortest HTTP response code