Ver Mensaje Individual
  #9 (permalink)  
Antiguo 06/11/2013, 10:09
Avatar de satanson123
satanson123
 
Fecha de Ingreso: julio-2012
Mensajes: 217
Antigüedad: 11 años, 9 meses
Puntos: 2
Respuesta: error con https con file_get_contents()

Cita:
Iniciado por jonni09lo Ver Mensaje
Por eso, como obtienes ese hipervinculo. Igual debes de usar expresiones regulares.

Ejemplo

Código PHP:
Ver original
  1. $text = '<a href="http://google.com">bla bla bla</a>';
  2.  
  3. preg_match_all("#<a href=\"(.*?)\">(.*?)<\/a>#", $text, $matches);
  4.  
  5. $counnt = count($matches[1]);
  6. for($i = 0; $i < count($matches[1]); $i++){
  7.     file_get_contents($matches[1][$i]);
  8. }

Esa sería una idea.

Saludos
me sigue saliendo el mismo error

Cita:
Warning: file_get_contents(<a href="http://www.gratisprogramas.us/descarga/la-contrasena-mas-usada-en-adobe-resulto-ser-123456/">http://www.gratisprogramas.us/descarga/la-contrasena-mas-usada-en-adobe-resulto-ser-123456/</a>) [function.file-get-contents]: failed to open stream: Invalid argument in F:\Program\Web\xampp\htdocs\warez\wp-content\themes\mystique\functions.php on line 764
talvez estoy haciendo algo mal

Código PHP:
function getTitle($content){
    
$str file_get_contents($content);
    if(
strlen($str)>0){
        
preg_match("/\<title\>(.*)\<\/title\>/",$str,$title);
        return 
$title[1];
    }
    
    
}
    
$ti getTitle($content);
    
$text $ti;
 
preg_match_all("#<a href=\"(.*?)\">(.*?)<\/a>#"$text$matches);
 
$counnt count($matches[1]);
for(
$i 0$i count($matches[1]); $i++){
    
$ti file_get_contents($matches[1][$i]);