SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Creating files

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Barbados
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating files

    I've been reading up and found the fopen, fwrite, fclose, fread, etc commands but is it possible to actually create files using php?

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Yes, if the file does not exist fopen will create it.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    from the table in the manual page....
    '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.
    Off Topic:


    good username
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    from the table in the manual page....
    '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.
    Off Topic:


    good username
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    Barbados
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys.
    I was doing something silly which made me think fopen wasn't working for this purpose. It's cleared up now though. Thanks again.


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
  •