What I am simply trying to do is take the following code:
$Anchors = '<a href="#" class="test1"><div class="test2"><a href="#" class="test3"><div class="test4">'
And get the value of the class attribute of the last anchor tag, in this case "test3." So far I have this:
if(preg_match('/(<a\s.*)(class="|\')([^-\'"]*)("|\')?.*?([^>])/i',$Anchors,$matches)){
But obviously its not doing what I want it to do, any help?