我对 PHP 很陌生,我只是在玩 PHP,
我通过ajax post从表单获取数据到php,数据被添加到文本文件中,我想按顺序放置这些数据
像
1) username , emailid , etc
2) username , emailid , etc
现在它像这样添加而没有任何数字
username , emailid , etc
username , emailid , etc
下面是我的PHP代码
<?php
//print_r($_POST);
$myFile = "feedback.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$comma_delmited_list = implode(",", $_POST) . "\n";
fwrite($fh, $comma_delmited_list);
fclose($fh);
?>