title: PHP regular expression - get text between slashes
body: <p>I need the following but I don't know how to do this .. with Regular Expression.</p>
  
  <p>First problem</p>
  
  <blockquote>
    <p>From $uri = '/page/subpage/?vars=bla' I want to extract only
    '/page/subpage/';</p>
  </blockquote>
  
  <p>Second problem</p>
  
  <blockquote>
    <p>The $uri = '/page/subpage/?vars=bla' I want to convert it to a
    friendly version '/page/subpage/vars-bla/'; Right now I can make it
    '/page-subpage-vars-bla/' but I want to keep the slashes.</p>
  </blockquote>
  
  <p>Thanks is advance!</p>