title: Remove the end of an url using php
body: <p>I have got this URL:</p>
  
  <p><code>http://website.com/theimage.jpg?sw=536&amp;sh=536&amp;sm=fit</code></p>
  
  <p>I want to end it at before the <code>sw</code> ending varies, though.  </p>
  
  <p>How can I do this?<br>
  Thank you.</p>