Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- function redirect($url){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- $a = curl_exec($ch);
- if(preg_match('#Location: (.*)#', $a, $r))
- $l = trim($r[1]);
- return $l;
- }
Add Comment
Please, Sign In to add comment