Trying to make my form inputs to be written in data.txt file. I want it to write in new line each time someone registers. Tried to use .PHP-EOL but it doesn't seem to add any new line after each entry!
<?php
$path = 'data.txt';
if (isset($_POST['firstname']) && isset($_POST['country']) && isset($_POST['email'])) {
$fh = fopen($path,"a+");
$string = $_POST['firstname'].' - '.$_POST['country'].' - '.$_POST['email'] .PHP_EOL;
fwrite($fh,$string); // Write information to the file
fclose($fh); // Close the file
}
?>