file_put_contents not creating txt file

前端 未结 6 773
后悔当初
后悔当初 2020-12-17 21:28

I currently have a php script that is running when a browser browser browses to the webpage. What I\'m trying to do is write a text file when the script runs that stores a v

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-17 21:56

    Have you tried chmodding the directory to 777?

    Try this:

    if(file_put_contents('file.txt', 'text')){
        die('yes');
    } else {
        die('no');
    }
    

    Might of misspelled something. ^

提交回复
热议问题