I have a function that will add the tag before a link and after the link. However, it breaks for some webpages. How would
It breaks for all URLs that contain "special" HTML characters. To be safe, pass the three string components through htmlspecialchars() before concatenating them together (unless you want to allow HTML outside the URL).