title: removing special chars and adding a dash between words php mysql
body: <p>I am trying to strip all special chars and add a dash between all the words. </p>
  
  <p>Example:</p>
  
  <p>Example text:
  How to make something, something else, and other stuff.</p>
  
  <p>Example string:</p>
  
  <pre><code>$string = "How to make something, something else, and other stuff.";
  </code></pre>
  
  <p>Example of how it should look:
  How-to-make-something-something-else-and-other-stuff</p>
  
  <p>I need a function that will strip all special chars but also add the dashes between every word "but also not adding dashes after the last word". Anyone have any ideas of how I should do this? I assume this is fairly simple. probably a preg_replace with regex which would solve the special char problem but adding the dashes is where I get confused and am not sure what to do.</p>