Can a PHP function make a new file?

Discussion in 'PHP' started by Imozeb, Feb 10, 2010.

  1. #1
    I know that PHP can create a brand new text file but can a PHP function create an html or PHP file also with some code inside the files?
     
    Imozeb, Feb 10, 2010 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
  3. Brandon.Add.On

    Brandon.Add.On Peon

    Messages:
    178
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes it can but make sure your files have the proper permissions ie writable. If it doesn't then you will get a 500 Internal Service Error.
     
    Brandon.Add.On, Feb 10, 2010 IP
  4. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    So... I can read an html or php file and copy it with some new code inserted inside it where I want to a new file with a new name?
     
    Imozeb, Feb 10, 2010 IP