Advertisement
Googleinurl

Capturar URL do link

Aug 30th, 2012
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.  
  3. $_POST['url'] = "http://www.grandprix-tunis.gov.tn/fr/index.php?id=4";
  4.  
  5. if (isset($_POST['url'])) {
  6.     $url = $_POST['url'];
  7.     $f = @fopen($url,"r");
  8. while($buf = fgets($f,1024)){
  9.     $buf = fgets($f, 4096);
  10.     preg_match_all("/<\s*a\s+[^>]*href\s*=\s*[\"']?([^\"' >]+)[\"' >]/isU",$buf,$words);
  11. for( $i = 0; $words[$i]; $i++ ){
  12. for( $j = 0; $words[$i][$j]; $j++ ){
  13.     $cur_word = strtolower($words[$i][$j]);
  14.     print "$cur_word<br></a>";
  15.     }
  16.   }
  17.  }
  18. }
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement