fgetcsv() is a PHP function which parses the line it reads for fields in CSV format and returns an array containing the fields read.
Questions tagged [fgetcsv]
491 questions
0
votes
2 answers
Read data from csv file into cakephp array
I am developing an application in cakephp where I want to import the csv file and save the data into database.
So I need some help in reading csv file into an array after which I will do some validation and insert data into database.
I have searched…

Rajput Pavan
- 175
- 1
- 2
- 10
0
votes
0 answers
UPLOAD CSV with special encoding (fgetcsv)
I have the problem with the php function fgetcsv() .
Lets start from the begin . I want to export csv files in ISO encoding and upload csv . With the export csv i dont have problem but with upload csv i have . This code runs perfect when i have not…

John Memb
- 23
- 2
- 3
- 7
0
votes
3 answers
Add each line of CSV file into an array using PHP
I am almost embarrassed to ask this, but I've been trying to accomplish this task for a few hours now. Without a thorough grasp of the fopen or fgetcsv functions, I'm a bit lost. Each example I find does not quite work for me.
I'm seeking a way to…
user1881190
0
votes
1 answer
Get email attachment cron job in php
Can anyone point me in the right direction on how to use php to grab the attachment from an email? I am already using php to successfully process a rather large .csv file and exucute different actions based on conditions. It is working very well,…

user1789437
- 490
- 1
- 7
- 22
0
votes
1 answer
fgetcsv not removing quotes
so I have this:
$handle = fopen($filepath, 'r');
$row = fgetcsv($handle, null, "\t", '"');
whereby $filepath contains a file with the following text:
"\A some text with space."
but then when I echo the contents of $row, it's not removing the…

pillarOfLight
- 8,592
- 15
- 60
- 90
0
votes
1 answer
getting extra commas and quotes with fgetcsv after it reads first line
I'm trying to import a large csv file that has 100,000 rows into a MySql table. I'm getting the error:
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'Dell',…

Jon
- 75
- 1
- 1
- 9
0
votes
2 answers
read csv contaning arabic and english in php
welcome
im trying to read csv file in php my file contain Arabic data
what charset must be use to show correct result ??
echo iconv("???????",'UTF-8',$data[$c]."\0");

Ala'a Hamda
- 31
- 1
- 9
0
votes
2 answers
How to AUTOINCREMENT starting from a certain number/offset?
I am running an fgetcsv query to import a bunch of data from a CSV into WordPress.
I am wondering how I can start an auto increment from a certain number, for example, from 1000 onwards.
$import1="INSERT into wp_postmeta…

Zach Nicodemous
- 9,097
- 9
- 45
- 68
0
votes
2 answers
Weird things about the entries get from fgetcsv() method
My php code is listed below, and the CSV file in the example is as simple as below:
Widget1, blue, $10, have stock
Widget2, red, $12, out of stock
Widget3, green, $14

Dennisboys
- 583
- 3
- 9
- 22
0
votes
1 answer
PHP array search and fgetcsv
sitting here for hours, but i can't see what the problem is.
I've got 1 file:
Gross_matching.csv:
Actionspiele,77
Strategiespiele,112
And the keywords are "Actionspiele, Strategiespiele".
And would like to get this file, and search after…

CasualBen
- 829
- 8
- 22
0
votes
2 answers
Insertion of arrays in to respective excel columns
m having 3 arrays say:
$first_array = array('val11','val21','val31');
$Second_array = array('val12','val22','val32');
$third_array = array('val13','val23','val33');
Is it possible to store this array values using fgetcsv() function of php in to…

Afsar
- 3,104
- 2
- 25
- 35
0
votes
1 answer
Improve performance for reading CSV file from ZIP?
Do you have any idea how to improve the performance by reading CSV file from a zip file?
Firstly it open the zip file, then put the data into a memory and then read it by fgetcsv
$zip = new ZipArchive();
if ($zip->open($fileName)) {
$info =…

I'll-Be-Back
- 10,530
- 37
- 110
- 213
0
votes
1 answer
DomPDF Codeigniter charset not correctly rendered
I have a nifty problem with DomPDF, it does bug-up accented characters.
I did everything that Phil Sturgeon suggests on Phil Sturgeon on UTF-8 support for Codeigniter
But with the only result that the first page of the PDF is okay but the rest is…

Maarten
- 55
- 1
- 5
0
votes
1 answer
Reading CSV in Symfony 1.4
I'd my project in Symfony 1.4 (Please keep version in mind)
As a new requirement, in admin panel, admin need to upload bulk images. For that, admin will provide a zip file with images and a csv file with required info about images.
I earlier handled…

Kapil Sharma
- 10,135
- 8
- 37
- 66
0
votes
1 answer
PHP Displaying multiple lines with fgetcsv
I'm using a CSV file to enter various things such as image filenames or descriptions to pull into variables for my site.
if (($handle = fopen("properties/properties.csv", "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
…