How can i create a text file at run time using php?

Discussion in 'PHP' started by Rumon BD, Aug 31, 2012.

  1. #1
    How can i create a text file at run time using php? I want to create in localhost server please guide me
     
    Rumon BD, Aug 31, 2012 IP
  2. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #2
    
    $fh = fopen('PATHTOFILE','w+');
    
    fwrite($fh, 'This is a test');
    
    flcose($fh);
    
    
    PHP:
    above will create a file, write this is a test in it and close it again.
     
    plussy, Aug 31, 2012 IP