PDA

View Full Version : Pattern Matching?


Tim Mousel
Thu 25th Jan '01, 1:48am
Hello,

I'm uploading jpg images and want to change the name. For example, if the original image is named profile.jpg and I want it to be renamed to $username.jpg, how would I write this? I'm assuming it would need to be a ereg_replace() statement?

Thanks,

Tim Mousel

Menno
Thu 25th Jan '01, 9:03am
This can be much better done trough the php copy and rename functions.

Dark_Wizard
Thu 25th Jan '01, 9:37am
Try this:


if (!rename ("./profile.jpg", "$username.jpg"))


Hope this helps...