我正在製作一個網站,稍後在世界上發佈,但我有一個表單,我要發送一個然後一個php腳本來處理所述表單,但是在我寫完腳本之後。 txt文件我不知道如何讓它放在一個分頁符或輸入,以便多個表單條目不在同一行,任何人都不知道如何解決這個問題? PHP代碼看起來像這樣在php中寫一個換行符
<?php
$username = $_POST['username'] ;
$email=$_POST['mail'];
$comment = $_POST['message'];
//the data
$data = "$username | $email | $comment ";
//open the file and choose the mode
$fh = fopen("comments.txt", "a");
fwrite($fh, $data,);
//close the file
fclose($fh);
print "Message Sent Successfully! Hit the back button for more skubduger.tk";
?>
試過這個,但它只是放一個空格,然後寫下一個提交。有什麼我做錯了,當我安裝php – user3466945
\ r \ n? \ n通常爲我工作 – dian