I've figured out how to allow people to upload picture files via a submission form and how to get all the relevant information about that file into the db and then from there used for output information.
My biggest problem lies in if 2 different people try to upload a picture named meandmydog.jpg. I'd like to do a replace on
meandmydog.jpg
to make it
$theirUserID$theirUsername.jpg
As that would make these picture files always unique.
(Input type is file, name MyFile)
I suspect preg_replace is what I want to do on $MyFile_name, but I'm stumped on how I tell it to leave the file extention alone (ie replace everything BEFORE the period).
Something tells me this is really stupid and simple and I'm just missing something here. Can someone help me out? :\