SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2002
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help manipulating files with php

    im not sure wether this blongs in the advanced php forum or not.. but i will just assume not, and get on with explaining my problem.

    i have been looking all over php.net for a way to create a file with php, and have yet to find one.. so i decided to go by copying a file, and renaming it as a new file ect.. but i have run into a problem.. all of the original file's content is still there...

    so i would like to know if there is a way to clear a file's content, and if possible, if there is a way to create a completely new file on a server.

    thanks

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try the function fopen()..
    http://www.php.net/manual/en/function.fopen.php

    using the 'w' mode. If the file does not exists, it will create it.

    Cheers.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •