PHP Create and Save a txt file to root directory

后端 未结 3 573
情书的邮戳
情书的邮戳 2020-11-28 04:47

I am trying to create and save a file to the root directory of my site, but I don\'t know where its creating the file as I cannot see any. And, I need the file to be overwri

3条回答
  •  广开言路
    2020-11-28 05:07

    If you are running PHP on Apache then you can use the enviroment variable called DOCUMENT_ROOT. This means that the path is dynamic, and can be moved between servers without messing about with the code.

    
    

提交回复
热议问题