Writing to files

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Writing to files

Post 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
User avatar
BigE
Site Admin
Posts: 139
Joined: Fri Apr 19, 2002 9:49 am
Location: Missouri, USA
Contact:

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Post Reply