title: How to remove a substring from a string using PHP?
body: <p>Given the following string</p>
  
  <pre><code>http://thedude.com/05/simons-cat-and-frog-100x100.jpg
  </code></pre>
  
  <p>I would like to use <code>substr</code> or <code>trim</code> (or whatever you find more appropriate) to return this</p>
  
  <pre><code>http://thedude.com/05/simons-cat-and-frog.jpg
  </code></pre>
  
  <p>that is, to remove the <code>-100x100</code>. All images I need will have that tagged to the end of the filename, immediately before the extension.</p>
  
  <p>There appears to be responses for this on SO re Ruby and Python but not PHP/specific to my needs.</p>
  
  <p><a href="https://stackoverflow.com/questions/599953/how-to-remove-left-part-of-a-string-in-python">How to remove the left part of a string?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/2782318/remove-substring-from-a-string">Remove n characters from a start of a string</a></p>
  
  <p><a href="https://stackoverflow.com/questions/5367164/remove-substring-from-the-string">Remove substring from the string</a></p>
  
  <p>Any suggestions?</p>