发起http请求后 network会显示各类加载的资源,php有什么办法获取某一type的name size等信息吗?
Is it possible to use the Curl Head protocol?
Reply content:
发起http请求后 network会显示各类加载的资源,php有什么办法获取某一type的name size等信息吗?
Is it possible to use the Curl Head protocol?
Description is not very clear, you are hoping:
Server-side initiative to initiate a request to get information? = = Feasible
Or to escalate the information that the server browser obtains after the client page is loaded? = = Not feasible
For 1,curl is a possible solution, do not need to use Head mode, Get,post,delete,put way you can get the return HTTP header, as long as you add Curlopt_header parameters
OK
$info = curl_getinfo($ch);
After you print out the $info, you need it.
$server[' PHPSelf '] #当前正在执行脚本的文件名, related to document root.
$_server[' argv '] #传递给该脚本的参数.
$_server[' argc '] #包含传递给程序的命令行参数的个数 (if run in command-line mode).
$server[' GATEWAYINTERFACE '] #服务器使用的 the version of the CGI specification. For example, "cgi/1.1".
$server[' SERVERNAME '] #当前运行脚本所在服务器主机的名称.
$server[' SERVERSoftware '] #服务器标识的字串, given in the header in response to the request.
$server[' SERVERPROTOCOL '] #请求页面时通信协议的名称和版本. For example, "http/1.0".
$server[' REQUESTMETHOD '] #访问页面时的请求方法. For example:, POST, PUT.
$server[' QUERYString '] #查询 (query).
$server[' DOCUMENTROOT '] #当前运行脚本所在的文档根目录. Defined in the server configuration file.
$server[' HTTPAccept '] #当前请求的 accept: The contents of the head.
$server[' HTTPAccept_charset '] #当前请求的 Accept-charset: The contents of the head. For example: "Iso-8859-1,*,utf-8".
$server[' HTTPAccept_encoding '] #当前请求的 accept-encoding: The contents of the head. For example: "gzip".
$server[' HTTPAccept_language '] #当前请求的 accept-language: The contents of the head. For example: "en".
$server[' HTTPCONNECTION '] #当前请求的 CONNECTION: The contents of the head. For example: "Keep-alive".
$server[' HTTPHost '] #当前请求的 host: The contents of the header.
$server[' HTTPREFERER '] #链接到当前页面的前一页面的 the URL address.
$server[' HTTPUSERAGENT '] #当前请求的 UserAgent: The contents of the head.
$_server[' HTTPS '-if accessed over HTTPS, it is set to a non-null value (on), otherwise it returns off
$server[' REMOTEADDR '] #正在浏览当前页面用户的 IP address.
$server[' REMOTEHOST '] #正在浏览当前页面用户的主机名.
$server[' REMOTEPORT '] #用户连接到服务器时所使用的端口.
$server[' SCRIPTFILENAME '] #当前执行脚本的绝对路径名.
$server[' SERVERADMIN '] #管理员信息
$server[' SERVERPORT '] #服务器所使用的端口
$server[' SERVERSIGNATURE '] #包含服务器版本和虚拟主机名的字符串.
$server[' PATHTranslated '] #当前脚本所在文件系统 the base path (not the document root).
$server[' SCRIPTNAME '] #包含当前脚本的路径. This is useful when the page needs to point to itself.
$server[' REQUESTUri '] #访问此页面所需的 URI. For example, "/index.html".
$server[' PHPAuth_User '] #当 PHP runs in the Apache module mode and is using the HTTP authentication feature, which is the user name entered by the user.
$server[' PHPAUTH_PW '] #当 PHP is running in the Apache module mode and is using the HTTP authentication function, which is the password that the user entered.
$server[' AUTHType '] #当 PHP runs in the Apache module mode and is using the HTTP authentication feature, which is the type of authentication.