位置: 编程技术 - 正文

PHP:get_headers()的用法_url函数(php get post)

编辑:rootadmin
get_headers

推荐整理分享PHP:get_headers()的用法_url函数(php get post),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:php getmypid,php get header,php get_headers,php get_headers,php getcwd,php getcontent,php get,php get header,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5)

get_headers — 取得服务器响应一个 HTTP 请求所发送的所有标头

说明 array get_headers ( string $url [, int $format = 0 ] )

get_headers() 返回一个数组,包含有服务器响应一个 HTTP 请求所发送的标头。

参数

url

目标 URL。

format

如果将可选的 format 参数设为 1,则 get_headers() 会解析相应的信息并设定数组的键名。

返回值 PHP:get_headers()的用法_url函数(php get post)

返回包含有服务器响应一个 HTTP 请求所发送标头的索引或关联数组,如果失败则返回 FALSE。

更新日志

版本 说明 5.1.3 自 PHP 5.1.3 起本函数使用默认的流上下文,其可以用 stream_context_get_default() 函数设定和修改。

范例

Example #1 get_headers() 例子

<?php$url='

以上例程的输出类似于:

Example #2 get_headers() using HEAD example

<?php//Bydefaultget_headersusesaGETrequesttofetchtheheaders.Ifyou//wanttosendaHEADrequestinstead,youcandosousingastreamcontext:stream_context_set_default(array('http'=>array('method'=>'HEAD')));$headers=get_headers('

参见

apache_request_headers() - 获取全部 HTTP 请求头信息

PHP:get_meta_tags()的用法_url函数 get_meta_tags(PHP4,PHP5)get_meta_tags从一个文件中提取所有的meta标签content属性,返回一个数组说明arrayget_meta_tags(string$filename[,bool$use_include_path=false])打开filename

PHP:http_build_query()的用法_url函数 http_build_query(PHP5)http_build_query生成URL-encode之后的请求字符串说明stringhttp_build_query(mixed$query_data[,string$numeric_prefix[,string$arg_separator[,int$enc_type=PHP_QUERY_RFC

PHP:base_encode()的用法_url函数 base_encode(PHP4,PHP5)base_encode使用MIMEbase对数据进行编码说明stringbase_encode(string$data)使用base对data进行编码。设计此种编码是为了使二进制数据可以通

本文链接地址:https://www.jiuchutong.com/biancheng/280582.html 转载请保留说明!

上一篇:PHP:rawurldecode()的用法_url函数

下一篇:PHP:get_meta_tags()的用法_url函数

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络