replace similar but different parts of a string in PHP?
===

So I grab a string (usually an image location). Ideally, I would like it to always be
  
    http://www.mydomain.com/images/cool-nifty-image.png

However, sometimes, it isn't always like that. sometimes it's

    http://www.mydomain.com/images/cool-lame-image-300x300.png

with the 300x300 being relevant to the size. in the above example, I need the image located at

    http://www.mydomain.com/images/cool-lame-image.png

(Yes, it ALWAYS exists.)

This would be easy it it was always triple digits. However, sometimes it can also be

        http://www.mydomain.com/images/cool-lame-image-300x99.png

or

        http://www.mydomain.com/images/cool-lame-image-99x99.png

Is there a way to find **" -#x#"** so I can find -100x99 and -875x200?