Advertisement
customhost

Untitled

Sep 12th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. <?php
  2.     $a = 'http://www.soccerfitness.com/testing/2/2-yo-yo-endurance-test';
  3. //  $a = 'http://belatmos.blogspot.com/2012/12/snow.html?showComment=1376946597608';
  4.     $contents = file_get_contents($a);
  5.    
  6.     $site = 'topwritingservices.net';
  7.     $site = str_ireplace('http://', '',$site);
  8.     $site = rtrim( $site, '/' );
  9.    
  10.     $key = 'topwritingservices.net';
  11.     $pattern = "~<a[\s]+(rel=\"nofollow\"[\s]+)?([^>]*)href=(\"|')http://{$site}[/]?\g{-1}(\g{-3})?([^>]*)>(http://|https://)?({$key})</a>~imu";
  12.    
  13.     $matched = preg_match_all( $pattern, $contents, $links );
  14.    
  15.     echo "<br>" . ( !$matched ? 'false': 'true' ) . "\n";
  16.    
  17.     print_r($links);
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement