Ver Mensaje Individual
  #84 (permalink)  
Antiguo 10/08/2011, 15:10
Avatar de reborn
reborn
 
Fecha de Ingreso: febrero-2010
Mensajes: 440
Antigüedad: 14 años, 2 meses
Puntos: 1
Respuesta: [APORTE] file_get_contents(), cURL, HTTP_Request

Llegue a esto pero me sigue cargando demasiado lento
Código PHP:
Ver original
  1. $options = array('http' =>
  2.     array( 'header' => 'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6' . PHP_EOL )
  3. );
  4.  
  5. $context = stream_context_create($options);
  6.  
  7. $page = file_get_contents('http://www.url.com', false, $context);
  8.  
  9. $doc = new DOMDocument();
  10. @$doc->loadHTML($page);
  11. $nodes = $doc->getElementsByTagName('title');
  12.  
  13. $title = $nodes->item(0)->nodeValue;
  14.  
  15. echo $title;

En q le estoy fallando?