Questions tagged [fputcsv]

fputcsv is a PHP function that formats a line (passed as a fields array) as CSV and writes it (terminated by a newline) to the specified file handle. `fputcsv` support started with PHP version 5.1.0.

354 questions
0
votes
1 answer

How to write an array as csv file content using php?

I am importing a CSV file into my site which contain Hebrew language.While opening the CSV file in the notepad, the Hebrew language content are not enclosed by the quotes. The content which is not in quotes are not read in my site. During the time…
anuja
  • 27
  • 8
0
votes
1 answer

Putting an array in to a CSV using fputcsv

I've got quite a few fields in my tables that I've serialised to keep the number of fields down. For everything else that works perfect as it stores the data and when needed I can use the following as an example: $dateofbirth =…
BN83
  • 902
  • 3
  • 9
  • 29
0
votes
0 answers

How to avoid fputcsv double quote enclosure

I am trying to replace empty field with \N in my csv. To do that I am reading the existing csv and after doing some check. I am writing csv row to temp file but this temp file add double quote around the string. I am using fputcsv() for this…
Ram Sharma
  • 8,676
  • 7
  • 43
  • 56
0
votes
1 answer

PHP script converting XML to CSV with column headers returning blank on some headers and rows

my full XML is below which is named user.xml: John
guilliam
  • 15
  • 5
0
votes
1 answer

Read and write using fgetcsv and fputcsv

I have a 3rd party source from where I am getting "csv" file. I wrote it inside a quote because it says it's a csv file but basically it's not. So I am taking that main source file then reading and putting the data in a "PROPER" csv file. The read…
Raj
  • 1,377
  • 6
  • 23
  • 48
0
votes
2 answers

CSV is not working PHP

I have a data in this form: 526,8696,Peach,Del Monte,Breakout Damage,TT Damage,Agricom,Mango,Damage to contents of cartons,4,2,P,2014-12-08,748,Atlanta 404,2014-12-08,Amir Here is the code to create CSV: $receiveQuery =…
Keep Coding
  • 636
  • 9
  • 26
0
votes
1 answer

Increase limit when using fputcsv

I recently asked a question about this, but think after 2 days of troubleshooting I have a better question to ask. Using fputcsv works great until the file is 4KB or bigger. How can I increase this limit? I have tested the following: php_value…
Kyle
  • 164
  • 13
0
votes
0 answers

Create and Post an Array[ Array[] ] to PHP - fputcsv()

I have been struggling with this... I need to post to a php page to create a csv file. The problem is, I can not figure out how to create a proper array and then to post it to the php to process. My php page has a function that iterates through the…
VIDesignz
  • 4,703
  • 3
  • 25
  • 37
0
votes
1 answer

MySQL and fputcsv PHP fields delimiter not working

Here's my code:
jm_
  • 631
  • 2
  • 12
  • 20
0
votes
1 answer

CSV not building properly with fputcsv when one cell includes Javascript code

I'm trying to create a csv file with php using fputcsv, where one of the cells includes javascript code. The problem I have is that the cell which holds the javascript code includes the following characters: ' | " \ / , and this is breaking the…
0
votes
3 answers

fputcsv - running out of memory during creation of larger files

I am creating sometimes large csv files from db information for users to then download - 100k or more rows. It appears I am running into a memory issue during the csv creation on some of the larger files. Here is an example of how I am currently…
user756659
  • 3,372
  • 13
  • 55
  • 110
0
votes
1 answer

how to handle comma string in fputcsv in php?

how to put array values in csv in correct format? here is my code: $title = Business - Research, MPhil/PhD | University of Greenwich | Research degrees; $description = ''; $keywords = ''; $list = $title.",".$keywords.",".$description; $fp =…
Muhammad Arif
  • 1,014
  • 3
  • 22
  • 56
0
votes
2 answers

Edit CSV field value for entire column

I have a CSV that is downloaded from the wholesaler everynight with updated prices. What I need to do is edit the price column (2nd column) and multiply the current value by 1.3 (30%). My code to read the provided CSV and take just the columns I…
BubbleMeda
  • 1
  • 1
  • 5
0
votes
1 answer

Checking while loop key exists in seperate array

Having checked a variety of questions but not being able to find quite what I need, I am at a bit of a loss. I am trying to chose the columns from MySQL I want exported to CSV by parsing the column names and adding the valid column names to a…
JBReading
  • 27
  • 7
0
votes
1 answer

using fputcsv is only returning one row of data to export

I have some code here that exports to a csv file. I connected to the database and saw that there was well over 30 entries or so. But I'm only getting one in the csv file. The top part gets the headings for the file and the bottom the values, the…
Alex Howell
  • 89
  • 2
  • 14