View Single Post
Old 08-01-2009, 02:39 PM  
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by ProG View Post
I don't entirely understand what you are trying to do but maybe this will help... :shrug:

Code:
$links  = '<a rel="nofollow" href="http://www.google.com/" id="extra">google</a>\r\n';
$links  .= '<a rel="nofollow" href="http://www.yahoo.com/" id="extra">yahoo</a>\r\n';
$links  .= '<a rel="nofollow" href=\'http://www.msn.com/\' id="extra">msn</a>\r\n';
$links  .= '<a href="http://www.bing.com/" id="extra">bing</a>\r\n';
$links  .= '<a href="http://www.ask.com/" id="extra">ask</a>\r\n';

$uri = 'www.bing.com';
$back = 'bing';

preg_match_all("/<a\s[^>]*href=([\"\']??)(http:\/\/{$uri}*?)([\"\']??)[^>]*>({$back})<\/a>/siU", $links, $matches);
print_r( $matches );
I get the same error as nation-x, I had to remove the http:\/\/ from the regex as it's already in the database as having it, but I even str_replace'd it and still get the error.
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote