note 79094 added to function.get-headers
| From: | PieterMarchand at telenet dot be | Date: | Sat, 10 Nov 2007 19:11:47 +0000 |
| Subject: | note 79094 added to function.get-headers | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-132166@lists.php.net to get a copy of this message | ||
Hello
just a tiny mod gives a cleaner solution
$key = array_shift(explode(':',$header));
$key = array_shift(explode(': ',$header));
notice the space after the colon.
Can be important if you want to modify this function in order to check if a url is valid. On
response code 301 or 302 you need the new location. This new location happens to have a colon in it,
the clock also has a few colons in it. Neither of them appear complete. With this tiny mod they do.
greetz,
Pieter
----
Server IP: 69.147.83.197
Probable Submitter: 84.193.119.188
----
Manual Page -- http://www.php.net/manual/en/function.get-headers.php
Edit -- https://master.php.net/note/edit/79094
Del: integrated -- https://master.php.net/note/delete/79094/integrated
Del: useless -- https://master.php.net/note/delete/79094/useless
Del: bad code -- https://master.php.net/note/delete/79094/bad+code
Del: spam -- https://master.php.net/note/delete/79094/spam
Del: non-english -- https://master.php.net/note/delete/79094/non-english
Del: in docs -- https://master.php.net/note/delete/79094/in+docs
Del: other reasons-- https://master.php.net/note/delete/79094
Reject -- https://master.php.net/note/reject/79094
Search -- https://master.php.net/manage/user-notes.php