Quick PHP rename file upload help.

777php

Diamond Member
Jul 17, 2001
3,498
0
0
I should know how to do this but for some reason my brain isn't working today, maybe I need some sleep.

I need to rename a file that has been uploaded while keeping the file extension the same. The files will primarily be images files so jpegs, gifs, pngs, and the linke.

I need to rename them all as thumb.(extension)

I was thinking of doing str_replace ('*' , 'thumb', $file);
but I am not sure if that will replace the entire filename with just thumb. Any suggestions?