$filename = 'log.txt'; $text = "Дата: " . date('Y-m-d H:i:s'); file_put_contents($filename, $text);