When the user hits submit I want the post data saved to a cvs file. i want to do an output of $valid[$var] into $cvsData with a “,” after each variable… where do I been with doing something like this? Also I was looking at fputcsv would this give me the same result by putting the “,”
$valid = true;
foreach($_POST as $var => $value) {
if(empty($value)) {
$valid[$var] = false;
} else {
$valid[$var] = true;
}
}
// $cvsData = $phone . “,” . $fn . “,” . $ln . “,” . $sos . “,” . $e1 .”\n”;
1 Answer