Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    file_get_contents e preg_match_all

    Codice PHP:
    <?php
    $link
    ="http://www.paginaweb.it";
    $httpfile file_get_contents($link) ;

    $res preg_match_all("/<a href[^>]+>/",$httpfile,$matches);
    foreach(
    array_unique($matches[0]) as $immagine) {
          echo 
    $immagine"
    "
    ;
    }
    ?>
    da quì mi estraggo tutti i link presenti in una determinata pagina ... ok ...
    la stampa è così però:
    <a href="http://www.paginaweb.it/">


    ..manca il tag di chiusura </a> e il testo tra i tag <a href> e </a>

    come aggiungere ciò che manca ?
    Tanto...lo fanno tutti... posso farlo anche io vero?

  2. #2
    $link="http://www.blogial.net";
    $httpfile = file_get_contents($link) ;
    $res = preg_match_all("/<a[^>]*>(.*?)<\/a>/",$httpfile,$matches);
    foreach(array_unique($matches[0]) as $immagine) {
    echo $immagine. "
    ";
    }
    Without faith, nothing is possible. With it, nothing is impossible
    http://ilwebdifabio.it

  3. #3
    Tanto...lo fanno tutti... posso farlo anche io vero?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.