当前位置:网站首页>Titles can only be retrieved in PHP via curl - header only retrieval in PHP via curl
Titles can only be retrieved in PHP via curl - header only retrieval in PHP via curl
2022-07-03 19:29:00 【javail】
problem :
Actually I have two questions. Actually, I have two questions .
(1) Is there any reduction in processing power or bandwidth used on remote server if I retrieve only headers as opposed to full page retrieval using php and curl?(1) If I only retrieve the title instead of using php and curl Perform a full page search , Then the remote server used processing capacity or bandwidth Will it decrease ?
(2) Since I think, and I might be wrong, that answer to first questions is YES , I am trying to get last modified date or If-Modified-Since header of remote file only in order to compare it with time-date of locally stored data, so I can, in case it has been changed, store it locally.(2) Because I think , I may be wrong , The answer to the first question is For sure , I try to get the last modification date or If-Modified-Since The remote file of the title is only to compare it with the time and date, and the locally stored data , So I can , If it has been changed , Store it locally .However, my script seems unable to fetch that piece of info, I get NULL , when I run this: however , When I run this , My script doesn't seem to get this information , I got NULL :
class last_change { public last_change; function set_last_change() { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "http://url/file.xml"); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_FILETIME, true); curl_setopt($curl, CURLOPT_NOBODY, true); // $header = curl_exec($curl); $this -> last_change = curl_getinfo($header); curl_close($curl); } function get_last_change() { return $this -> last_change['datetime']; // I have tested with Last-Modified & If-Modified-Since to no avail }}In case $header = curl_exec($curl) is uncomented, header data is displayed, even if I haven't requested it and is as follows: If $header = curl_exec($curl) Not enabled , Then the header data is displayed , Even if I didn't ask it , As shown below :
HTTP/1.1 200 OKDate: Fri, 04 Sep 2009 12:15:51 GMTServer: Apache/2.2.8 (Linux/SUSE)Last-Modified: Thu, 03 Sep 2009 12:46:54 GMTETag: "198054-118c-472abc735ab80"Accept-Ranges: bytesContent-Length: 4492Content-Type: text/xmlBased on that, 'Last-Modified' is returned. On this basis , return “Last-Modified”.
So, what am I doing wrong? that , What did I do wrong ?
Solution :
Reference resources : https://stackoom.com/en/question/5miZ边栏推荐
- [wallpaper] (commercially available) 70 wallpaper HD free
- Merge K ascending linked lists
- Zhang Fei hardware 90 day learning notes - personal records on day 2, please see my personal profile / homepage for the complete
- Web Security (VIII) what is CSRF attack? Why can token prevent csdf attacks?
- Day10 -- forced login, token refresh and JWT disable
- FBI警告:有人利用AI换脸冒充他人身份进行远程面试
- Chapter 1: find the algebraic sum of odd factors, find the same decimal sum s (D, n), simplify the same code decimal sum s (D, n), expand the same code decimal sum s (D, n)
- 10 smart contract developer tools that miss and lose
- [proteus simulation] a simple encrypted electronic password lock designed with 24C04 and 1602LCD
- Chapter 2: 4-digit Kaplan number, search even digit Kaplan number, search n-digit 2-segment sum square number, m-digit ingenious square number without 0, specify the number to form a 7-digit square nu
猜你喜欢
![CesiumJS 2022^ 源码解读[7] - 3DTiles 的请求、加载处理流程解析](/img/70/6fd00146418e5d481e951d51428990.png)
CesiumJS 2022^ 源码解读[7] - 3DTiles 的请求、加载处理流程解析

PR 2021 quick start tutorial, material import and management

10 smart contract developer tools that miss and lose

BOC protected alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC / alanine zinc porphyrin Zn · TAPP ala BOC supplied by Qiyu

02 -- QT OpenGL drawing triangle

Chapter 2: 4-digit Kaplan number, search even digit Kaplan number, search n-digit 2-segment sum square number, m-digit ingenious square number without 0, specify the number to form a 7-digit square nu

Xctf attack and defense world crypto master advanced area olddriver

2022.2.14 Li Kou - daily question - single element in an ordered array

If the warehouse management communication is not in place, what problems will occur?

第一章:喝汽水,阶梯电费计算,阶梯电费计算函数,个人所税,求解平方根不等式,简化求解平方根不等式,求解调和级数不等式,解不等式:d<1+1/2-1/3+1/4+1/5-1/6+..士1/n
随机推荐
Flume learning notes
第二章:求a,b的最大公约与最小公倍数经典求解,求a,b的最大公约与最小公倍数常规求解,求n个正整数的的最大公约与最小公倍数
Yolov3 network model building
[proteus simulation] a simple encrypted electronic password lock designed with 24C04 and 1602LCD
Valentine's Day - make an exclusive digital collection for your lover
PR 2021 quick start tutorial, how to create a new sequence and set parameters?
Meso tetra [P - (p-n-carbazole benzylidene imino)] phenylporphyrin (tcipp) /eu (tcipp) [pc( α- 2-oc8h17) 4] and euh (tcipp) [pc (a-2-oc8h17) 4] supplied by Qiyue
Day11 ---- 我的页面, 用户信息获取修改与频道接口
Php based campus lost and found platform (automatic matching push)
CMD implements the language conversion of locale non Unicode programs
第一章:求奇因数代数和,求同吗小数和s(d, n),简化同码小数和s(d, n),拓广同码小数和s(d, n)
Redis master-slave synchronization, clustering, persistence
These problems should be paid attention to in the production of enterprise promotional videos
第一章:拓广同码小数和s(d, n)
Xctf attack and defense world crypto advanced area best_ rsa
Thinking about festivals
2022-06-28 advanced network engineering (XIII) IS-IS route filtering, route summary, authentication, factors affecting the establishment of Isis neighbor relations, other commands and characteristics
Today I am filled with emotion
Chapter 1: simplify the same code decimal sum s (D, n)
Sentinel source code analysis part I sentinel overview