I'm trying to retrieve link text from an HTML file. Each of the link have a specific class applied to them, but the urls are different.
I have the following:
...
<a class="fetch-me" href="products/1">Find ME!!!</a>
...
<a class="fetch-me" href="products/2">Me too!</a>
...
I am using the following PHP code, but always getting more than I want:
preg_match_all('<a class="fetch-me" href=".*">(.*)</a>)siU', $string, $matching_data);