If you have a single block of data, creating a table with fputcsv
works great; it assumes the first row is a header and the following rows are of the same format.
But what do you do if you have multiple, differently formatted blocks of data you want to write out to a CSV:
Business Name: name-of-business. Date: current date
Notes: single line of notes
Model | Product
model1 | Product 1
model2 | Product 2
model3 | Product 3
The first line is basically a single line table with 4 columns and no headers The second line is a single line table with 2 columns and no headers Then the data - typical two column table with headers