I am retrieving file locations and names from a database, the are in this format
http://domain.com/subdir/etc/etc/etc/picimage-niceone_Main-150×150.jpg
They are all dynamic, so there are hundreds of them all with different names, but one thing is constant is the last – and then the file dimensions.
What i need to do is strip everything after the last – so it turns into the following.
http://domain.com/subdir/etc/etc/etc/picimage-niceone_Main.jpg
Any help would be awesome.
Cheers,
This will remove anything between the last
-and the file extension.