I am new to PHP, and I am trying to search through an unordered list and grab each of the anchor text elements. I am using this code, but it only returns the first anchor text element, "Link1" Is there a way to expand this code so that I can find all the link elements in my unordered list? Many thanks in advance.
$links = '<ul><li><a href="http://www.blahblah1.com">Link1</a></li>
<li><a href="http://www.blahblah2.com">Link2</a></li>
<li><a href="http://www.blahblah3.com">Link3</a></li>
<li><a href="http://www.blahblah4.com">Link4</a></li>
</ul>';
$matchstring = "/\"\>(.+)\<\/a/";
preg_match ($matchstring, $links, $match);
echo $match[1];