Answers for "write new line in file php"

PHP
0

php append line to file

file_put_contents("filename.txt","new line to appended\n",FILE_APPEND);
Posted by: Guest on March-04-2021
1

php fwrite new line

$data = 'my data' . PHP_EOL . 'my data';
$fp = fopen('my_file', 'a');
fwrite($fp, $data);
fclose($fp);
Posted by: Guest on December-13-2020

Browse Popular Code Answers by Language