public function updateData(){
# Running this function each time it will save the timestamp in a text file.
$path2file = "/docs/";
$fileName = "timestamp.txt";
$data = time()."".PHP_EOL; // PHP_EOL - new line
$fp = fopen($path2file.$filename, 'a');
fwrite($fp, $data);
}
1条答案
按热度按时间7vux5j2d1#
你可以在这里找到更多的信息和例子-〉https://www.w3schools.com/php/php_file_open.asp