title: PHP str_replace or preg_match or strpos when specific string plus if integer
body: <p>I am trying to remove the two strings and two integers from a URL string if there is a specific match, for example from those WP generated featured image crop URLS:</p>
  
  <pre><code>http://website.com/uploads/image1-150x150.jpg
  http://website.com/uploads/image2-300x160.jpg
  </code></pre>
  
  <p>Basically I want to be left with:</p>
  
  <pre><code>http://website.com/uploads/image1.jpg
  http://website.com/uploads/image2.jpg
  </code></pre>
  
  <p>I therefore need to check, if the URL has the order of a minus "-", then an INT, then the letter "x", then again an INT, before the .jpg ending. If so, then it should remove all of that.</p>
  
  <p>What is the best way and how would I need to do it? preg_replace or str_replace or strpos?</p>