处理文件 / 文本文件

<?php

$filePath  = getcwd() . "/tmp/file.txt";
$text = "Line 1\nLine 2";
file_put_contents($filePath, $text);