I have a string like this but number of links can be different for each situation:
<a>link 1</a> >> <a>link 2</a> >> <a>link 3</a> >> <a>link 4</a>
I want to remove last link in that string and convert like this:
<a>link 1</a> >> <a>link 2</a> >> <a>link 3</a> >> link 4
Is there a simple function for that ? I know i can use several functions like preg_match, preg_match_all, explode etc… With these functions, removing first link tags pretty easy though removing last one is a little bit confusing.
Thanks for help.
As of regexp…