PHP简单写入文件demo

PHP简单写入文件demo

<?php
    $filepath = 'log/';
    if (!file_exists($filepath)){
        mkdir ($filepath,0777,true);
    }
    //a:追加  w:覆盖
    $myfile = fopen("log/log.docx", "a") or die("Unable to open file!");
    fwrite($myfile, "112");
    fclose($myfile);
?>

PS:仅记录

猜你喜欢

转载自blog.csdn.net/yuzsmc/article/details/82015024