Hi!
This should be pretty simple, but has kept me surfing these posts forever...
I have a filename variable which I want to split in 2 parts.
Example (which is a tricky filename, since it has 2 dots):
$filename = "somefile.name.jpg"
The first part should be: somefile.name
The second: jpg
If it was just one . there wouldn't be any problem, explode would solve that easily. But I can't rely on people uploading files with "good" filenames ;-).
So how do i split a string in two parts, at the location of the last . ?
Maybe there's some regexp that can solve this?
Any suggestions are very much appreciated.
/Anders