title: PHP remove links to specific website but keep text
body: <p>For example, <code>&lt;a href="http://msdn.microsoft.com/art029nr/"&gt;remove links to here but keep text&lt;/a&gt; but &lt;a href="http://herpyderp.com"&gt;leave all other links alone&lt;/a&gt;</code></p>
  
  <p>I've been trying to solve this using preg_replace. I've searched through here and found answers that solve pieces of the problem.</p>
  
  <p>The answer at <a href="https://stackoverflow.com/questions/9856933/php-remove-all-hyperlinks-of-specific-domain-from-text">PHP: Remove all hyperlinks of specific domain from text</a> removes links to a specific url but removes the text also.</p>
  
  <p>The site at <a href="http://php-opensource-help.blogspot.ie/2010/10/how-to-remove-hyperlink-from-string.html" rel="nofollow noreferrer">http://php-opensource-help.blogspot.ie/2010/10/how-to-remove-hyperlink-from-string.html</a> removes a hyperlink from a string but I can't seem to modify the pattern so that it applies only to a specific website.</p>