I am attempting to code a small script to process the fields from a form
and write it to a text file using the semi-colon as the delimiter. So
far I am successful in doing that using the following:
$incoming_field s = array_keys($_PO ST);
$incoming_value s = array_values($_ POST);
for ($i = 0; $i < count($incoming _fields); $i++) {
$fp = fopen("formresu lts.txt", "a");
fwrite($fp,stri pslashes("$inco ming_values[$i];"));
fclose($fp);
}
But what I am encountering difficulty in is putting a line break (\n) at
the end of only the final entry so that the data from each form
submission is on a separate line. How do I approach doing this?
and write it to a text file using the semi-colon as the delimiter. So
far I am successful in doing that using the following:
$incoming_field s = array_keys($_PO ST);
$incoming_value s = array_values($_ POST);
for ($i = 0; $i < count($incoming _fields); $i++) {
$fp = fopen("formresu lts.txt", "a");
fwrite($fp,stri pslashes("$inco ming_values[$i];"));
fclose($fp);
}
But what I am encountering difficulty in is putting a line break (\n) at
the end of only the final entry so that the data from each form
submission is on a separate line. How do I approach doing this?
Comment