最新下载
热门教程
- 1
 - 2
 - 3
 - 4
 - 5
 - 6
 - 7
 - 8
 - 9
 - 10
 
php get_headers 与get_meta_tags函数实例
时间:2022-07-02 10:18:57 编辑:袖梨 来源:一聚教程网
*/
$url='https://www.***111cn.net';          //定义url
print_r(get_headers($url));         //无格式获取
print_r(get_headers($url,1));         //带上格式获取
/*
array
(
    [0] => http/1.1 200 ok
    [1] => connection: close
    [2] => date: sat, 11 dec 2010 05:43:46 gmt
    [3] => content-length: 69617
    [4] => content-type: text/html
    [5] => content-location: https://www.*111**cn.net/
    [6] => last-modified: sat, 11 dec 2010 05:19:51 gmt
    [7] => accept-ranges: bytes
    [8] => etag: "e8be4b9f398cb1:6c66"
    [9] => server: microsoft-iis/6.0
    [10] => x-powered-by: .net
)
array
(
    [0] => http/1.1 200 ok
    [connection] => close
    [date] => sat, 11 dec 2010 05:43:47 gmt
    [content-length] => 69617
    [content-type] => text/html
    [content-location] => 
    [last-modified] => sat, 11 dec 2010 05:19:51 gmt
    [accept-ranges] => bytes
    [etag] => "e8be4b9f398cb1:6c66"
    [server] => microsoft-iis/6.0
    [x-powered-by] => 
)
get_meta_tags($url);
获取指定网页的description,abstract,keywords等信息
*/
$tags=get_meta_tags('https://www.*111**cn.net/');      //提取meta标签
print_r($tags)            //输出数组全部内容
/*
array
(
    [description] => 教程网提供专业网页设计教程与网页制作教程包括有photoshop教程,flash,html,css教程,dreamweaver,fireworks,asp,php教程,jsp教程,,网站建设,网站开发,,平面设计,个人网站,网页素材
    [abstract] => 提供最新的网页制作教程、网页设计教程、网页特效,为个人网站提供网页素材模板和网页视频学习。
    [keywords] => 网页设计教程,网页制作教程,网页学习,photoshop,flash,html,css,dreamweaver,fireworks,asp,php,jsp,asp.net,网页特效,平面设计,网页素材
)
注意:使用该函数需要把 php.ini里面的allow_url_ = on,才能使用
相关文章
- 重返未来1999贝丽尔队伍搭配推荐 11-04
 - 重返未来1999贝丽尔塑造抽取建议 11-04
 - 逃离塔科夫兑换码怎么用 逃离塔科夫最新兑换码大全 11-04
 - Dark Quest4兑换码是什么 黑暗探险4兑换码大全分享 11-04
 - 梦魇之王NIGHTMARE兑换码分享 梦魇之王最新兑换码大全 11-04
 - 洛克王国世界翼王技能怎么搭配-圣羽翼王技能搭配推荐 11-04