View Single Post
Old 08-01-2009, 01:31 PM  
ProG
Confirmed User
 
Join Date: Apr 2009
Posts: 1,319
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 );
__________________
History will be kind to me for I intend to write it.
ProG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote