title: PHP: Remove certain character from string excluding/ignoring URL
body: <p>I have a string as below</p>
  
  <p><strong>String</strong></p>
  
  <pre><code>&lt;span class="post-excerpt"&gt; - &lt;a href="./posts/the-post-title"&gt;17 posts&lt;/a&gt; - Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. At solmen va esser necessi far uniform grammatica, pronunc&lt;/span&gt;
  </code></pre>
  
  <p>Now I want to remove <code>-</code> from string <strong><em>(not from the URL within the string)</em></strong></p>
  
  <p>I have tried to use <code>str_replace()</code> but than it is removing from URL also and that resulting broken links of course.</p>
  
  <p>Anyone can please help me to remove <code>-</code> from the string but not from the URL</p>