|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34058 get_headers() retrieve a particular respons
Submitted: 2005-08-10 02:42 UTC Modified: 2015-03-27 14:19 UTC
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5CVS-2005-08-10 (dev) OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-08-10 02:42 UTC]
Any change we can make get_headers() to act like parse_url(), i.e. retrive a particular respons (see:

Reproduce code:
 $last_modified = get_headers("", 1, "Last-Modified");
 echo $last_modified;

Expected result:
Wed, 08 Jan 2003 23:11:55 GMT


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-11 03:56 UTC] arnar at 8 dot is
Patch has been submitted to php.internals

Arnar Mar Sig
 [2013-10-29 07:46 UTC]
-Package: Feature/Change Request +Package: *General Issues
 [2013-10-29 07:46 UTC]
There's an impl attached ...

Something to think about maybe ... if a server sends multiple headers of the same name you will only get the first returned, if we want to return a string there's not really another (good) way.
 [2015-03-27 14:19 UTC]
-Status: Open +Status: Wont fix
 [2015-03-27 14:19 UTC]
I don't think it has much need now that we have array dereferencing:
$last_modified = get_headers("", 1)["Last-Modified"];
echo $last_modified;

(hi Hannes! :P)
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 04:03:37 2021 UTC