If use get_headers() on this link - http://www.yahoo.com/r/cf/r/cf/r/pb/r/s2/r/fo/s/275681/
I get the following results -
HTTP/1.0 301 Moved Permanently
Location: http://us.rd.yahoo.com/O=1/home/trough/class/*http://classifieds.yahoo.com
Cache-Control: no-cache
HTTP/1.1 301 Moved Permanently
Date: Tue, 28 Feb 2006 22:58:29 GMT
Cache-Control: private, max-age=0, no-cache
P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
Location: http://classifieds.yahoo.com
Connection: close
Content-Type: text/html
Set-Cookie: R=o=1/home/trough/class/t=1141167509; path=/; domain=.yahoo.com; expires=Thu, 02 Mar 2006 22:58:29 GMT
HTTP/1.1 302 Found
Date: Tue, 28 Feb 2006 22:58:30 GMT
P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
Location: http://www.yahoo.com
Connection: close
Content-Type: text/html
HTTP/1.1 200 OK
Date: Tue, 28 Feb 2006 22:58:31 GMT
P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"
Cache-Control: private
Vary: User-Agent
Set-Cookie: FPB=c9u0kfkjp1209lcn; expires=Thu, 01 Jun 2006 19:00:00 GMT; path=/; domain=www.yahoo.com
Connection: close
Content-Type: text/html
Typing that address into my browser, I get redirected to http://www.yahoo.com/
if i try to display the result for the [Location] key I get an array (as you can see there are 3 locations listed). How do i extract only the relevant one??