当前位置:网站首页>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边栏推荐
- BOC protected phenylalanine zinc porphyrin (Zn · TAPP Phe BOC) / iron porphyrin (Fe · TAPP Phe BOC) / nickel porphyrin (Ni · TAPP Phe BOC) / manganese porphyrin (Mn · TAPP Phe BOC) Qiyue Keke
- BUUCTF
- I didn't cancel
- QT -- qfile file read / write operation
- Compared with 4G, what are the advantages of 5g to meet the technical requirements of industry 4.0
- We have built an intelligent retail settlement platform
- If the warehouse management communication is not in place, what problems will occur?
- 第一章:求同吗小数和s(d, n)
- Zhang Fei hardware 90 day learning notes - personal records on day 2, please see my personal profile / homepage for the complete
- 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)
猜你喜欢

第一章: 舍罕王失算
![Chapter 2: find the number of daffodils based on decomposition, find the number of daffodils based on combination, find the conformal number in [x, y], explore the n-bit conformal number, recursively](/img/c5/0081689817700770f6210d50ec4e1f.png)
Chapter 2: find the number of daffodils based on decomposition, find the number of daffodils based on combination, find the conformal number in [x, y], explore the n-bit conformal number, recursively

第二章:4位卡普雷卡数,搜索偶数位卡普雷卡数,搜索n位2段和平方数,m位不含0的巧妙平方数,指定数字组成没有重复数字的7位平方数,求指定区间内的勾股数组,求指定区间内的倒立勾股数组

PR 2021 quick start tutorial, material import and management

Counting from the East and counting from the West will stimulate 100 billion industries. Only storage manufacturers who dare to bite the "hard bone" will have more opportunities

Common text labels

【LeetCode】【SQL】刷题笔记
![第二章:基于分解的求水仙花数,基于组合的求水仙花数, 兰德尔数,求[x,y]内的守形数,探求n位守形数,递推探索n位逐位整除数](/img/c5/0081689817700770f6210d50ec4e1f.png)
第二章:基于分解的求水仙花数,基于组合的求水仙花数, 兰德尔数,求[x,y]内的守形数,探求n位守形数,递推探索n位逐位整除数
![[new year job hopping season] test the technical summary of interviewers' favorite questions (with video tutorials and interview questions)](/img/4e/a51365bb88b1fc29d1c77fcdde5350.jpg)
[new year job hopping season] test the technical summary of interviewers' favorite questions (with video tutorials and interview questions)
![[optics] dielectric constant calculation based on MATLAB [including Matlab source code 1926]](/img/cb/ee696d5a7d6bef96fe0db89e8478ed.jpg)
[optics] dielectric constant calculation based on MATLAB [including Matlab source code 1926]
随机推荐
第二章:求长方体数组,指定区间内的完全数,改进指定区间内的完全数
交叉编译Opencv带Contrib
Day_ 18 IO stream system
Use unique_ PTR forward declaration? [repetition] - forward declaration with unique_ ptr? [duplicate]
2022-06-28 网工进阶(十三)IS-IS-路由过滤、路由汇总、认证、影响ISIS邻居关系建立的因素、其他命令和特性
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
Streaming media server (16) -- figure out the difference between live broadcast and on-demand
[water quality prediction] water quality prediction based on MATLAB Fuzzy Neural Network [including Matlab source code 1923]
03 -- QT OpenGL EBO draw triangle
Chapter 1: drinking soft drinks, step tariff calculation, step tariff calculation function, personal income tax, solving square root inequality, simplifying solving square root inequality, solving dem
BUUCTF
I study database at station B (4): DQL
PR 2021 quick start tutorial, how to create a new sequence and set parameters?
How does if ($variable) work? [repeat] - how exactly does if ($variable) work? [duplicate]
P1891 crazy LCM (Euler function)
01 - QT OpenGL display OpenGL window
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
Win10 share you don't have permission
[mathematical modeling] ship three degree of freedom MMG model based on MATLAB [including Matlab source code 1925]
Chapter 1: find the factorial n of n!