Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/08/2013, 14:03
minimal
 
Fecha de Ingreso: diciembre-2011
Mensajes: 408
Antigüedad: 12 años, 4 meses
Puntos: 18
php obtener la url real de un feed

hola estoy construyendo una pagina web pero esta lee un xml de feed burner y me gustaria saber la url real de link del item del feed estaba probando con curl pero demora mucho

Código PHP:
Ver original
  1. function getCurlUrl($url)
  2.   {
  3.     $ch = curl_init($url);
  4.  
  5.     curl_setopt($ch, CURLOPT_HEADER, true);
  6.     curl_setopt($ch, CURLOPT_NOBODY, true);
  7.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  8.  
  9.     $response = curl_exec($ch);
  10.     curl_close($ch);
  11.  
  12.     $header = "Location: ";
  13.     $pos = strpos($response, $header);
  14.     $pos += strlen($header);
  15.     $redirect_url = substr($response, $pos, strpos($response, "\r\n", $pos)-$pos);
  16.    
  17.     return $redirect_url;
  18.   }