Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Saving data in CSV in PHP
04-23-2012, 11:20 PM #1
- Join Date
- Sep 2011
- Thanked 0 Times in 0 Posts
Saving data in CSV in PHP
I have made a function to save data in a CSV file, for this I used the codes on PHP Manual website here:
The codes works, except, when I open the file in Excel, I want also a title to appear above the table cell for each column. For example, let's say in the first column of the excel sheet, I am saving some car brands, but can I also make a title automatically via PHP for this column and appear it in bold in Excel? I mean like:
I mean the title Car which is in bold, can I automatically insert it in PHP when processing the CSV? Because now it is only the car brands which are saved...
04-24-2012, 02:53 PM #2
- Join Date
- Jun 2003
- Cottage Grove, Minnesota
- Thanked 1,091 Times in 1,082 Posts
You can't do any formatting with CSV.
CSV is plain text only.
Use XML instead:
Sort of hard to explain, but you can control data (values) as well as cell formatting.
Also some PHP classes for doing Excel stuff ...
Looks sort of advanced to me.
I've never attempted it.
Last edited by mlseim; 04-24-2012 at 03:01 PM.