Thanks Devinemke,
That looks like it work, EXCEPT the problem I'm having is a bit more complex I suppose. Let me put it into context.
I've written a script to take an image uploaded from a form, rename it to the person's first and last name, then copy it to a local directory.
The problem is, when I copy it over from $_FILES['imagefile']['name'] and rename the file sometimes the extension is wrong because as it stands right now I've set it to only determine the extension as the last three characters of the name.
SO... I can't really use pathinfo because i need the extension length before I save it locally and rename it, so that I can process the image correctly.
Any idea?
Thanks for helping!