I am going share how to append content in text file using PHP.
$myfile = fopen("text.txt", "a") or die("Unable to open file!");
$txt = "my text 1";
fwrite($myfile, $txt. PHP_EOL);
$txt2 = "my text 2";
fwrite($myfile, $txt2. PHP_EOL);
fclose($myfile)