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
-2
votes
2 answers
PHP Undefined Offset with fgetcsv
Okay, I've spent several hours on this problem and I'm not sure what's going on. I think I just need a fresh perspective on this problem especially since I've been up for over 24 hours and the deadline for this is in five hours.
I am getting an…

trice
- 35
- 1
- 8
-2
votes
2 answers
if (in_array) doesn't seem to be seeing what's in the array, what have I got wrong?
I have a bit of PHP code for searching the first 'column' of a CSV file for a filename, and if it's found it 'removes' it into a 'removed' folder.
There must be something wrong with my code because if (in_array is not seeing a name in the array…

UnluckyForSome9
- 301
- 1
- 9
-2
votes
1 answer
How to manually create specific json
how to get this json from a csv file. The csv file has the headers:
Description, BusinessSurname, IsCustomer, IsSupplier, AddressType, BusinessAddress, IsInternational
And First row:
Contact1, Contact1, True, True, Business, 123 Fake St, False
I…

user8114890
- 31
- 7
-2
votes
1 answer
converting fgetcsv response into specific json
I have a .CSV file with headings:
Description, BusinessSurname, IsCustomer, IsSupplier, AddressType, Business
Address, IsInternational.
First row:
Contact1, Contact1, True, True, Business, 123 Fake St, False
Remaining rows not important, its just…

user8114890
- 31
- 7
-2
votes
2 answers
my php explode function react on "," issue
I have some issues with explode function.
I set it like this:
$p = explode(";", $data[$c]);
end I received results fine in first 18 rows and then I got error message:
Notice: Undefined offset: 6 in C:\xampp\htdocs\slovenac\zaloge\parser.php on line…

Aleksandar Milic
- 39
- 1
- 8
-2
votes
1 answer
Warning with, fopen, feof and fgetcsv
I'm in trouble, I am failing to understand why this error is happening.
So when I only run this code,
function getClientProject($cliente)
{
$file = fopen("Projetos.csv","r");
$ArrayCount = 0;
$bool = false;
while(! feof($file))
…

user3161343
- 63
- 5
-2
votes
1 answer
webpage not available error in php
I have following function to import subscriber list in database, this works fine when subscriber list is less than 500, but more than 500 record is there than browser show page is no available but all subscribers list get insert.
Following is my…

naran.arethiya
- 43
- 9
-3
votes
1 answer
want to get the IDs from a CSV file having same values in other column in php
I want to get the IDs which are in first column of CSV file according to the values in second column having same data.
I mean if code is EF in csv then its IDs value should get 1,2,3,4,5 and so on for other codes.
SO i took all code values in string…

Panky
- 1
-3
votes
2 answers
Convert a string into list of arrays
How do I convert a REQUEST string into arrays in a list like the following?
$_REQUEST["InventoryData"] == sku=qty&234444=11&ShirtBig=111&ShirtSmall=101&empty=0
Array ( [0] => sku [1] => qty )
Array ( [0] => 234444 [1] => 11 )
Array ( [0] =>…

Jeff
- 67
- 1
- 8
-4
votes
1 answer
fgetcsv interpreting numbers incorrectly
I have a problem when I read csv files that contain values like 886468000000, it gets parsed as 8,86468E+11, which is a huge problem for my app, because I need to parse and retain the number in original form.
I google around the documentation and…

The Law
- 344
- 3
- 20
-4
votes
1 answer
import csv data to mysaql database in php and show error
I want to import csv data file to masql databse in php.
I want to know which line and column have error on data format
Like row no 24 and column phone no : data is not number .
Please help me plzzzzzzzzz
For example I made this function
function…

Durgesh Pandey
- 119
- 1
- 1
- 11