Is there a possibility to add form input to a certain row/column in a CSV file?
For example, if a user gives input to a "Name" section -> Adrian Smith. How do I put that name to a CSV file that has headers starting from row 11 with header "Name" and the names should start from row 12? Also if there's a header "Color" in column B row 11, how do I get data to certain columns?
$headers = array("Name", "Website");
$data = array(
array(
"name" => "Adrian Smith",
"website" => "http://example.com"
),
array(
"name" => "Meredith Cooper",
"website" => "http://example.com"
),
);
$fh = fopen("file.csv", "w");
fputcsv($fh, $headers);
foreach($data as $fields) {
fputcsv($fh, $fields);
}
fclose($fh);
I got this far, but this obviously just adds them to the start. I have no idea how to identify certain rows and columns.