Ok so I'm just now starting to play around with preg_match
in PHP and I've run into a problem. I am pulling information from an RSS feed which is giving me a description. In the description I want to pull the web address from the second to last link in the description. There may be any number of links, but the link I need is always second to last. However, when I use this code it pulls all of the links in the description:
preg_match('#<a href=".*</a>#', $description, $match);
I've tried PREG_OFFSET_CAPTURE
, which seems to do the same thing as far as the output is concerned. Everything I have googled is only telling me how to grab the last things in the string.