3

How can I get the Header Informations like this web page (below) with using php

This web site Check website HTTP Server Header Information

Result:

HTTP Status for: "http://www.abc.com"
The title is: ""

Keywords: ""
Description: ""

HTTP/1.1 200 OK
Date: Fri, 22 Feb 2013 12:00:56 GMT
Server: Apache/2.2.3 (Debian) PHP/4.4.4-8+etch6
X-Powered-By: PHP/4.4.4-8+etch6
Keep-Alive: timeout=300
Connection: Keep-Alive
Content-Type: text/html
4

3 に答える 3

4

PHP 関数を使用しますget_headers

$headers = get_headers($url, 1);

参照: http://php.net/manual/en/function.get-headers.php

メタ キーワードメタの説明も必要な場合は、get_meta_tags()を使用します。

$tags = get_meta_tags($url);
于 2013-02-22T11:41:42.380 に答える
3

PHP関数を使用できますget_header();。この関数は、すべてのヘッダーフィールドを含む配列を返します。

詳細については、http://php.net/manual/en/function.get-headers.phpを参照してください。

于 2013-02-22T11:42:24.530 に答える
2

あなたが使用することができます:

print_r(get_headers($url));
于 2013-02-22T11:42:12.573 に答える