PHP only requests the size of the Web page file, do not return the page content, how to solve
Source: Internet
Author: User
PHP only requests the size of the Web page file, does not return the page content,
In fact, I want to analyze the export links of tens of thousands of sites at once, so to download the source code,
In fact, some of the site's source code is very long, it will hinder the efficiency of my program execution, so I would like to not return the content of the Web page to obtain the size of the Web file, before deciding whether to perform the analysis
------Solution--------------------
Print_r ( get_headers(' http://forum.csdn.net/PointForum/Manage/TopicManageView.aspx?forumID=94985a29-c8e9-4552-9be4-b01061443744 &topicid=0758c3a4-5c85-4434-8a26-0d2c9ccc4c45&date=2012-09-06+21%3a18%3a02&v=-1 ', 1));
------Solution--------------------
This is seldom used. Study.
------Solution--------------------
Get_headers () returns an array that contains the headers sent by the server in response to an HTTP request. If it fails, it returns false and emits an e_warning level error message.
If the optional format parameter is set to 1, Get_headers () parses the corresponding information and sets the array's key name.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service