View Single Post
Old 08-01-2009, 12:32 PM  
Killswitch - BANNED FOR LIFE
Guest
 
Posts: n/a
Quote:
Originally Posted by KillerK View Post
PHP Code:
$link '<a href="http://www.google.com">google</a>';
preg_match('/a href="([^"]*?)">([^"]*?)<\/a>/'$link$matches);
print_r($matches);

should print

Array
(
    [
0] => a href="http://www.google.com">google</a>
    [
1] => http://www.google.com
    
[2] => google

That help at all?
Yeah works perfect if it's just <a href="http://www.google.com">google</a> and not if it was <a rel="nofollow" href="http://www.google.com" title="google">google</a>

What I need it to do is find any a tag, with the specified href and anchor, ignores other attributes but returns true if the a tag has both the anchor and href
  Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote