Page 1 of 1

Writing to files

Posted: Thu Feb 13, 2003 11:30 am
by oldtimer
Currently I write to a file for one app I do. However I have heard there is a way to write unique files name. Basically it checks and if there is afile of that name then it does a different. Anyone know what that command is? I have been looking at php.net all morning.

Jerry

Posted: Thu Feb 13, 2003 11:34 am
by BigE
well... the function that checks for an existing file is file_exists() I don't know of any one function to do both, but you can use that and md5(rand()) to get file names and such. Hope that helps.

Posted: Thu Feb 13, 2003 2:20 pm
by volka