title: Remove unnecessary slashes from path
body: <pre><code>$path = '/home/to//my///site';
  </code></pre>
  
  <p>I am trying to remove unnecessary forward slashes <code>/</code> from the path above </p>
  
  <p>I am trying to get this results </p>
  
  <pre><code>/home/to/my/site
  </code></pre>
  
  <p>I've failed with <code>str_replace</code>, since i don't know the number of slashes.</p>