fopen
(PHP 3, PHP 4, PHP 5)
fopen -- Opens file or URL
[...]
'w' Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.
dirname() or basename() which is more appropriate
Moderator: General Moderators