sybrex on 10/05/11
Last Edited at 10/05/11 01:33am
$url = 'http://google.com';$ch = curl_init();curl_setopt ($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_HEADER, true);curl_setopt($ch, CURLOPT_NOBODY, true);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);$response = curl_exec($ch);curl_close($ch); $header = "Location: ";$pos = strpos($response, $header)+strlen('Location: ');$redirect_url = substr($response, $pos, strpos($response, "", $pos)-$pos);
Report this snippet Tweet
Comment:
You need to login to post a comment.