Originally posted by LordShryku
[man]basename[/man]
or
[man]substr[/man] with [man]strrchr[/man].
That's two choices. There's more ways.
Basename() returns the full filename without any directory information.
To get the suffix you can use substr($filename,-4); ... but thats only a quick cheat that grabs the last 4 chars of a string (.php for example). Files are not guaranteed to fit that profile, especially in Mac or Unix environments.