I don't know if its already posted in this forum such code reffering to get header methods ..
I was searching for them , found 'em...by google, this one's are less known by codders...
i recommend to use byget_headers($url); because it can group header by values for example
[Set-Cookie] => Array
(
[0] => bb_lastvisit=1330471210; expires=Wed, 27-Feb-2013 23:20:10 GMT; path=/; domain=.coding-talk.com
[1] => bb_lastactivity=0; expires=Wed, 27-Feb-2013 23:20:10 GMT; path=/; domain=.coding-talk.com
[2] => PHPSESSID=25af1d1282d889181079f37e765ed991; path=/
[3] => override=deleted; expires=Mon, 28-Feb-2011 23:20:09 GMT
[4] => vbseo_loggedin=deleted; expires=Mon, 28-Feb-2011 23:20:09 GMT; path=/
)
That's all folks
found them interesting so i thot they could be usefull for others to .. enjoy them
I was searching for them , found 'em...by google, this one's are less known by codders...
PHP Code:
<?php
//2 Other Methods to get url headers
function byget_headers($url){print_r(get_headers($url)); /*print_r(get_headers($url, 1));*/}
function byresponse_header($url){file_get_contents($url); var_dump($http_response_header);}
//i didn't count to cUrl because i think you all know that method...
?>
i recommend to use byget_headers($url); because it can group header by values for example
[Set-Cookie] => Array
(
[0] => bb_lastvisit=1330471210; expires=Wed, 27-Feb-2013 23:20:10 GMT; path=/; domain=.coding-talk.com
[1] => bb_lastactivity=0; expires=Wed, 27-Feb-2013 23:20:10 GMT; path=/; domain=.coding-talk.com
[2] => PHPSESSID=25af1d1282d889181079f37e765ed991; path=/
[3] => override=deleted; expires=Mon, 28-Feb-2011 23:20:09 GMT
[4] => vbseo_loggedin=deleted; expires=Mon, 28-Feb-2011 23:20:09 GMT; path=/
)
That's all folks
found them interesting so i thot they could be usefull for others to .. enjoy them