How to detect the finish with file_put_contents() in php?

前端 未结 3 744
独厮守ぢ
独厮守ぢ 2020-12-17 01:08

In PHP, i will write (create) the file using file_put_contents($filename, $data);
It is ok, but i want to detect the finish event of process.

Curre

3条回答
  •  离开以前
    2020-12-17 01:28

    It puts everything on hold until it's over

    So you could use something like this to determine when it has finished writing the file.

    echo "The file's contents are now being written, please wait.";
    file_put_contents($filename, $data);
    echo "The file's contents have been written.";
    

提交回复
热议问题