I have the following string that is part of a larger string which I think I'll need to perform a preg_replace on.
> <a href=''>About Us</a>
The larger string is:
<a href='http://ecolution.dev'>Home</a> > <a href=''>About Us</a> > Meet the Directors
Now I can match the first string easily with something like / .*?<\/a>\s+/ - that works fine.
What I actually need to do is remove the > <a href=''> from the string and also the </a>. So that plain text is left in the larger string.
I could remove the 2 parts separately in multiple preg_replace calls but that doesn't seem like the best option to me at all.
Is there a way to get any text between > <a href=''> and </a> and then output it as plain text so that > <a href=''>About Us</a> simply becomes About Us?
EDIT
I should have mentioned this earlier. This is a dynamically created breadcrumb system inside ExpressionEngine. Some entries have empty href, so <a href=''>abc</a> and those entries need to have their a tags removed, hence why trying to match the characters/strings above so that it's just plain text
<a href='http://ecolution.dev'>Home</a> > <a href=''>About Us</a> > Meet the Directors
would become
<a href='http://ecolution.dev'>Home</a> > About Us > Meet the Directors
htmlspecialchars_decode()to convert those and then use some HTML parser. Have fun.