Ver Mensaje Individual
  #8 (permalink)  
Antiguo 02/01/2013, 14:25
Avatar de Capimaster
Capimaster
 
Fecha de Ingreso: agosto-2004
Mensajes: 494
Antigüedad: 19 años, 8 meses
Puntos: 2
Respuesta: Extraer parte de un sitio con la funcion URLopen

okei ya di un paso gracias andres...

Código PHP:
Ver original
  1. <?php
  2.  
  3.  
  4. function get_links($url) {
  5.  
  6.     // Create a new DOM Document to hold our webpage structure
  7.     $xml = new DOMDocument();
  8.  
  9.     // Load the url's contents into the DOM
  10.     $xml->loadHTMLFile($url);
  11.  
  12.    
  13.    
  14.     // Empty array to hold all links to return
  15.     $links = array();
  16.  
  17.     //Loop through each <a> tag in the dom and add it to the link array
  18.     foreach($xml->getElementsByTagName('img') as $link) {
  19.         $links[] = array('url' => $link->getAttribute('src'));
  20.     }
  21.  
  22.     //Return the links
  23.     return $links;
  24.    
  25. }
  26.  
  27. $distro = get_links("http://cinemex.com/cines/83");
  28. print_r ($distro);
  29. ?>

ahora con esto extraigo todas las imagenes del sitio... pero quiero filtrar la informacion, solo quiero que me de las que comiencen con http://cache-cmx.netmx.mx/image/muestras/ esta ruta.. como lo puedo hacer
__________________
http://www.elcapitolio.com.mx - Ocotlán, Jalisco, México