title: Replace spaces with a dash in a URL
body: <p>I managed to replace special characters such as : ; / etc in my URL but now it has the spaces again. Here is my code:</p>
  
  <pre><code>&lt;h3&gt;&lt;a href="&lt;?php echo (isset($row_getDisplay['post_id']) ? $row_getDisplay['post_id'] : ''); ?&gt;_&lt;?php echo str_replace(array(':', '\\', '/', '*'), ' ', urldecode($row_getDisplay['title'])); ?&gt;.html" &gt;&lt;?php echo (isset($row_getDisplay['title']) ? $row_getDisplay['title'] : ''); ?&gt;&lt;/a&gt;&lt;/h3&gt;
  </code></pre>
  
  <p>I want it to like it is remove special characters as well as replace spaces with dashes. </p>