Try this
get_headers():
PHP Code:
$url = 'http://www.codingforums.com';
echo "<pre>";
print_r(get_headers($url, 1));
echo "</pre>";
That will output something like:
Code:
Array
(
[0] => HTTP/1.1 200 OK
[Date] => Sat, 29 Dec 2012 08:19:04 GMT
[Server] => Apache/2.2.10 (Unix) mod_ssl/2.2.10 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimited/1.4 PHP/5.2.6
[X-Powered-By] => PHP/5.2.6
[Set-Cookie] => Array
(
[0] => bbsessionhash=cb9550ca1e0e70135402c4cbf73e736b; path=/; HttpOnly
[1] => bblastvisit=1356769144; expires=Sun, 29-Dec-2013 08:19:04 GMT; path=/
[2] => bblastactivity=0; expires=Sun, 29-Dec-2013 08:19:04 GMT; path=/
)
[Expires] => 0
[Cache-Control] => private, post-check=0, pre-check=0, max-age=0
[Pragma] => no-cache
[X-UA-Compatible] => IE=7
[Connection] => close
[Content-Type] => text/html; charset=ISO-8859-1
)
If you want to spoof stuff like
UserAgent, that can be easily done using cURL.