I am trying to come up with a regular expression that will get the html link and look for if that link has a rel="nofollow" attribute to it and store them in variables. I have come up with the top of my head code to get the links using the strip_tags() with php but it returns not just the links but all other text. Not sure if there is a function already in php that can do this or I need a regex for that along with finding the nofollow tag.
Ultimately I want to scan a webpage and return 2 things.
The link and whether there is a nofollow tag associated with that link on the page
I don't need to pull the nofollow tag text obviously I just need to know if that link has the tag. I am assuming preg_match will be used for that purpose along with a regex. Anyone help me out?