PHP - Cutting filenames
<p>I was wondering if someone could help me.</p>

<p>I have filenames being outputted by my database in the following type of format</p>

<blockquote>
  <p>filename-144x96.jpg</p>
  
  <p>filename-144x180.jpg</p>
  
  <p>file-name-144x180.jpg</p>
</blockquote>

<p>etc etc etc</p>

<p>Is there a way that i can ditch everything including and after the last - ??</p>

<p>So that after it processed, the filenames would be</p>

<p>filename.jpg</p>

<p>filename.jpg</p>

<p>file-name.jpg</p>

<p>Im having some trouble trying to figure this one out.</p>

<p>Cheers,</p>
