I\'m trying to write username and password to a new line in a txt file. The output should be something like this in the txt file. I know this is not very secure but its just
Use PHP_EOL which produces \r\n or \n
\r\n
\n
$data = 'my data' . PHP_EOL . 'my data'; $fp = fopen('my_file', 'a'); fwrite($fp, $data); fclose($fp);
// File output
my data my data