append new text in new line php file code example
Example 1: append new line php
$data = 'some data'.PHP_EOL;
$fp = fopen('somefile', 'a');
fwrite($fp, $data);
Example 2: php append line to file
file_put_contents("filename.txt","new line to appended\n",FILE_APPEND);