I need to create a CSV file from a PHP array, I'm aware of the fputcsv() function. I've a recollection that a better function exists for this kind of stuff but I can't find it nor remember it's name.
Does anyone know of such function or am I imagining?
I might be making some confusion with the fgetcsv() function and the str_getcsv() ...
When I use fputcsv to write out a line to an open file handle, PHP will add an enclosing character to any column that it believes needs it, but will leave other columns without the enclosures.
For example, you might end up with a line like this
11,"Bob ",Jenkins,"200 main st. USA ",etc
Short of appending a bogus space to the end of e...
I was just about to ask the same questions as the question aksed here.... http://stackoverflow.com/questions/2489553/forcing-fputcsv-to-use-enclosure-for-all-fields
The question was
When I use fputcsv to write out a line
to an open file handle, PHP will add
an enclosing character to any column
that it believes needs it, but wi...
I wrote the code below to split up a fullname from a .csv file into a first name, middle name, and last name. It works well and gives the following kind of output:
Eric,T.,Nolan
Mary,,Worth
Jim,T.,Lane
E.,Thomas,Powell
William,Reilly,Smith
Johnny,,Depp
Stevie,de,la Soul
I can get it to print to the screen, but need help putting it b...
Hi there,
I need to export data from mysql to a csv file with column heading but i dont have file permission on the server. Is there any otherway to do it? i.e. using php fwrite? or fputcsv?
Any help will be much appriciate.
Thanks.
...