---
title: "关于get_headers跟get_meta_tags如何使用"
author: "limon87"
date: "2013-05-03T18:12:09Z"
tags: []
categories: ["编程语言"]
slug: "get-headers-get-meta-tags"
draft: false
lastmod: "2013-05-03T18:12:09Z"
id: 1859476
url: "https://limon87.iteye.com/blog/1859476"
---

```
print_r(get_meta_tags('http://www.muyangcheng.com'));
print_r(get_headers('http://www.muyangcheng.com',1));
print_r(get_headers('http://www.muyangcheng.com'));
```

结果如下：

```
Array
(
    [generator] => phpwind 8.7
    [description] => 牧羊城（www.muyangcheng.com），广州论坛是一个集广州消费经验、广州生活信息、广州超市商场打折优惠信息、广州人脉关系为一体的城市社区、生活门户、广州论坛，牧羊城（广州论坛）专注于广州城市百姓生活，无论你是老广，还是新广人，这是你我共同的网上生活家园！
    [keywords] => 牧羊城网站,广州新闻,广州城市,广州优惠,牧羊城,牧羊人,muyangcheng,广州超市商场打折优惠,广州消费,广州生活信息,广州生活社区,广州生活门户,广州论坛生活,广州论坛分类信息,广州团购,广州论坛优惠信息,广州论坛,羊城美食,广州网,广州BBS,广州论坛网
    [msapplication-task] => name=我的设置; action-uri=profile.php; icon-uri=images/ico/edit.ico
)
Array
(
    [0] => HTTP/1.1 200 OK
    [Server] => nginx/1.0.8
    [Date] => Tue, 19 Jun 2012 03:11:25 GMT
    [Content-Type] => text/html
    [Connection] => close
    [Vary] => Accept-Encoding
    [X-Powered-By] => PHP/5.3.8
    [Set-Cookie] => Array
        (
            [0] => b9971_c_stamp=1340075484; expires=Wed, 19-Jun-2013 03:11:24 GMT; path=/
            [1] => b9971_lastvisit=0%091340075484%09%2Findex.php; expires=Wed, 19-Jun-2013 03:11:24 GMT; path=/
            [2] => b9971_lastpos=index; expires=Wed, 19-Jun-2013 03:11:24 GMT; path=/
            [3] => b9971_lastvisit=0%091340075484%09%2Findex.php; expires=Wed, 19-Jun-2013 03:11:24 GMT; path=/
        )
 
)
Array
(
    [0] => HTTP/1.1 200 OK
    [1] => Server: nginx/1.0.8
    [2] => Date: Tue, 19 Jun 2012 03:11:26 GMT
    [3] => Content-Type: text/html
    [4] => Connection: close
    [5] => Vary: Accept-Encoding
    [6] => X-Powered-By: PHP/5.3.8
    [7] => Set-Cookie: b9971_c_stamp=1340075486; expires=Wed, 19-Jun-2013 03:11:26 GMT; path=/
    [8] => Set-Cookie: b9971_lastvisit=0%091340075486%09%2Findex.php; expires=Wed, 19-Jun-2013 03:11:26 GMT; path=/
    [9] => Set-Cookie: b9971_lastpos=index; expires=Wed, 19-Jun-2013 03:11:26 GMT; path=/
    [10] => Set-Cookie: b9971_lastvisit=0%091340075486%09%2Findex.php; expires=Wed, 19-Jun-2013 03:11:26 GMT; path=/
)
```