Re: [PHP] fgetcsv doesn't return an array?

2012-03-18 Thread Tamara Temple
On Thu, 15 Mar 2012 12:09:53 -0500, Jay Blanchard jay.blanch...@sigmaphinothing.org sent: I thought that fgetcsv returned an array. I can work with it like an array but I get the following warning when using it |Warning: implode(): Invalid arguments passed on line 155 154

Re: [PHP] fgetcsv doesn't return an array?

2012-03-18 Thread Lester Caine
Tamara Temple wrote: On Thu, 15 Mar 2012 12:09:53 -0500, Jay Blanchard jay.blanch...@sigmaphinothing.org sent: I thought that fgetcsv returned an array. I can work with it like an array but I get the following warning when using it |Warning: implode(): Invalid arguments passed on line 155

Re: [PHP] fgetcsv doesn't return an array?

2012-03-16 Thread Jay Blanchard
[snip] Not sure why, but ok. Thanks everyone! An empty line would lead to $csvCurrentLine == array() which as a boolean would be false but would not necessarily mean EOF. By using === to check the value the expression will only evaluate to false at EOF or an error. -Stuart [/snip] Makes

Re: [PHP] fgetcsv doesn't return an array?

2012-03-15 Thread Matijn Woudt
On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard jay.blanch...@sigmaphinothing.org wrote: I thought that fgetcsv returned an array. I can work with it like an array but I get the following warning when using it |Warning:  implode(): Invalid arguments passed on line 155 154     $csvCurrentLine

Re: [PHP] fgetcsv doesn't return an array?

2012-03-15 Thread Jay Blanchard
On 3/15/2012 12:23 PM, Matijn Woudt wrote: On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard jay.blanch...@sigmaphinothing.org wrote: I thought that fgetcsv returned an array. I can work with it like an array but I get the following warning when using it |Warning: implode(): Invalid arguments

Re: [PHP] fgetcsv doesn't return an array?

2012-03-15 Thread Jim Lucas
On 03/15/2012 10:09 AM, Jay Blanchard wrote: I thought that fgetcsv returned an array. I can work with it like an array but I get the following warning when using it |Warning: implode(): Invalid arguments passed on line 155 154 $csvCurrentLine = fgetcsv($csvFile, 4096, ','); 155 $currentLine =

Re: [PHP] fgetcsv doesn't return an array?

2012-03-15 Thread Andrew Ballard
On Thu, Mar 15, 2012 at 1:29 PM, Jay Blanchard jay.blanch...@sigmaphinothing.org wrote: On 3/15/2012 12:23 PM, Matijn Woudt wrote: On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard jay.blanch...@sigmaphinothing.org  wrote: I thought that fgetcsv returned an array. I can work with it like an

Re: [PHP] fgetcsv doesn't return an array?

2012-03-15 Thread Lester Caine
Jay Blanchard wrote: 154 $csvCurrentLine = fgetcsv($csvFile, 4096, ','); 155 $currentLine = implode(,, $csvCurrentLine); I am using it in a loop. End Of File is an error? You certainly need to break out on $csvCurrentLine = false which indicates end of file at least. My own

Re: [PHP] fgetcsv doesn't return an array?

2012-03-15 Thread Matijn Woudt
On Thu, Mar 15, 2012 at 6:40 PM, Andrew Ballard aball...@gmail.com wrote: On Thu, Mar 15, 2012 at 1:29 PM, Jay Blanchard jay.blanch...@sigmaphinothing.org wrote: On 3/15/2012 12:23 PM, Matijn Woudt wrote: On Thu, Mar 15, 2012 at 6:09 PM, Jay Blanchard jay.blanch...@sigmaphinothing.org  

Re: [PHP] fgetcsv doesn't return an array?

2012-03-15 Thread Jay Blanchard
[snip] Please, don't do that. Use this instead: while (($csvCurrentLine = fgetcsv($csvFile, 4096, ',')) !== FALSE) { } [/snip] Not sure why, but ok. Thanks everyone! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] fgetcsv doesn't return an array?

2012-03-15 Thread Stuart Dallas
On 15 Mar 2012, at 20:26, Jay Blanchard wrote: [snip] Please, don't do that. Use this instead: while (($csvCurrentLine = fgetcsv($csvFile, 4096, ',')) !== FALSE) { } [/snip] Not sure why, but ok. Thanks everyone! An empty line would lead to $csvCurrentLine == array() which as a boolean

Re: [PHP] fgetcsv

2008-01-09 Thread Jim Lucas
Danny Brow wrote: Hi Everyone, I'm trying to compare a value to the first field in a csv fILE (example of the data below). Using while takes too long and I can't figure out how to compare just one row at a time. I've tried some variations of the following. //Common for all trials $demoID =

Re: [PHP] fgetcsv

2008-01-09 Thread Daniel Brown
On Jan 9, 2008 5:35 PM, Danny Brow [EMAIL PROTECTED] wrote: Hi Everyone, I'm trying to compare a value to the first field in a csv fILE (example of the data below). Using while takes too long and I can't figure out how to compare just one row at a time. I've tried some variations of the

Re: [PHP] fgetcsv

2008-01-09 Thread Chris
Danny Brow wrote: Hi Everyone, I'm trying to compare a value to the first field in a csv fILE (example of the data below). Using while takes too long and I can't figure out how to compare just one row at a time. I've tried some variations of the following. So are you trying to compare the

Re: [PHP] fgetcsv

2008-01-09 Thread Danny Brow
I need to compare the first field of each row. But this idea is shot to hell, i've been running one of the examples on the file and it's been about an hour+ already... 6500 records have to be checked... I think MySQL is calling my name right now. Thanks, Dan On Thu, 2008-01-10 at 09:59 +1100,

Re: [PHP] fgetcsv

2008-01-09 Thread Jim Lucas
Danny Brow wrote: I need to compare the first field of each row. But this idea is shot to hell, i've been running one of the examples on the file and it's been about an hour+ already... 6500 records have to be checked... I think MySQL is calling my name right now. Thanks, Dan On Thu,

RE: [PHP] fgetcsv

2008-01-09 Thread Bastien Koert
http://ca.php.net/manual/en/function.fgetcsv.php _ Discover new ways to stay in touch with Windows Live! Visit the City @ Live today! http://getyourliveid.ca/?icid=LIVEIDENCA006 -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] fgetcsv

2008-01-09 Thread Richard Lynch
On Wed, January 9, 2008 4:35 pm, Danny Brow wrote: I'm trying to compare a value to the first field in a csv fILE (example of the data below). Using while takes too long and I can't figure out how to compare just one row at a time. I've tried some variations of the following. //Common for

Re: [PHP] fgetcsv

2008-01-09 Thread Richard Lynch
6500 rows is chump-change. You probably don't have the fgetcsv inside the while loop to get past the first row... :-) On Wed, January 9, 2008 6:09 pm, Danny Brow wrote: I need to compare the first field of each row. But this idea is shot to hell, i've been running one of the examples on the

RE: [PHP] fgetcsv

2008-01-09 Thread Danny Brow
Um, I've read the manual. On Wed, 2008-01-09 at 20:11 -0500, Bastien Koert wrote: http://ca.php.net/manual/en/function.fgetcsv.php _ Discover new ways to stay in touch with Windows Live! Visit the City @ Live today!

Re: [PHP] fgetcsv

2008-01-09 Thread Danny Brow
You are so right, takes all of 0.122 s to process the whole file with the fgetcsv inside the while loop Guess I need to look up why this was the problem. Thanks everyone! On Wed, 2008-01-09 at 20:59 -0600, Richard Lynch wrote: 6500 rows is chump-change. You probably don't have the

RE: [PHP] fgetcsv() excel data missing

2005-02-18 Thread Jay Blanchard
[snip] I used fgetcsv() function to get the data from a excel file. While reading the data it shows some special characters . I found the same problems in http://bugs.php.net/bug.php?id=12127edit=2 Is it a bug? [/snip] What special characters does it show? -- PHP General Mailing List

RE: [PHP] fgetcsv() excel data missing

2005-02-18 Thread Binoy AV
Hi, Thanks for the reply. It shows ÐÏࡱá\\þÿ etc. source code I used is $handle = fopen (file.xls,r); while ($data = fgetcsv ($handle, 1000, ,)) { $num = count($data); for ($c=0; $c $num ; $c++) { $str_email = $data[$c]; echo

RE: [PHP] fgetcsv() excel data missing

2005-02-18 Thread Jay Blanchard
[snip] Thanks for the reply. It shows ÐÏࡱá\\þÿ etc. source code I used is $handle = fopen (file.xls,r); while ($data = fgetcsv ($handle, 1000, ,)) { $num = count($data); for ($c=0; $c $num ; $c++) { $str_email = $data[$c]; echo

RE: [PHP] fgetcsv() excel data missing

2005-02-18 Thread Binoy AV
Thanks Jay. Could anybody please tell me how to read the data from an excel file ? It should work independent of the operating system. I don't want the csv format. Binoy __ __ __ __ Sent via the WebMail system at

RE: [PHP] fgetcsv() excel data missing

2005-02-18 Thread Jay Blanchard
[snip] Could anybody please tell me how to read the data from an excel file ? It should work independent of the operating system. I don't want the csv format. [/snip] Start here http://us4.php.net/com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] fgetcsv() excel data missing

2005-02-18 Thread M. Sokolewicz
Binoy AV wrote: Thanks Jay. Could anybody please tell me how to read the data from an excel file ? It should work independent of the operating system. I don't want the csv format. excel files aren't independent of the OS, csv files are. Excel files need to be parsed, because they contain

Re: [PHP] fgetcsv() excel data missing

2005-02-18 Thread Bret Hughes
On Fri, 2005-02-18 at 09:12, M. Sokolewicz wrote: Binoy AV wrote: Thanks Jay. Could anybody please tell me how to read the data from an excel file ? It should work independent of the operating system. I don't want the csv format. excel files aren't independent of the OS, csv

RE: [PHP] fgetcsv() excel data missing

2005-02-18 Thread Richard Lynch
Binoy AV wrote: Could anybody please tell me how to read the data from an excel file ? It should work independent of the operating system. I don't want the csv format. For your first step, you'll have to convince Microsoft to OpenSource their code... Oh, yeah. You can't do that. :-) --

Re: [PHP] fgetcsv

2003-11-16 Thread Derek Ford
zhuravlev alexander wrote: Hello. I wonder if PHP has fgetcsv() function why doesn't PHP has fputcsv ? -- zhuravlev alexander u l s t u n o c ([EMAIL

Re: [PHP] fgetcsv quit working......

2003-03-09 Thread Jason Sheets
Check to make sure the file exists, you should probably through some debug code around the area that is failing. Jason On Sun, 2003-03-09 at 18:50, CDitty wrote: I have a customer who's webhost upgraded their server recently and a script that was working fine quit working. The error they are

Re: [PHP] fgetcsv quit working......

2003-03-09 Thread CDitty
I thought about this possibility, but it turns out 4 different scripts on the same server accessing different files from different locations and using different methods are all failing. Chris At 07:53 PM 3/9/2003, Jason Sheets wrote: Check to make sure the file exists, you should probably

Re: [PHP] fgetcsv Help

2002-12-12 Thread @ Edwin
Hello, Justin French [EMAIL PROTECTED] wrote: [snip] Sample line from your CSV should look like this: --- 1,foo,harry said \what is it?\,foo 1,bah,\don't know\ said sally,something --- When echoing these values to the browser, you would strip the slashes. [/snip] The double quotes

Re: [PHP] fgetcsv Help

2002-12-11 Thread DL Neil
Richard, I am parsing a csv file with fgetcsv and the fields are surrounding by double quotes, now I am running into a problem periodically that when there are quotes within the value it is treating it like another value instead of the same value. Any ideas on how to get around that? I am

Re: [PHP] fgetcsv Help

2002-12-11 Thread Justin French
How is the CSV being generated? Seems to me like your problem isn't ggetcsv(), but rather the file itself. Commonly, a CSV file is a series of values, separated by a comma (duh!!). The separated values are generally enclosed in double quotes (), as it would appear yours are. Any double quotes

Re: [PHP] fgetcsv Help

2002-12-11 Thread Richard Baskett
I did email the company that the csv feed is coming from so we'll see what comes of that. I really hope they fix it. Well here is what I did to solve the problem: I pulled the csv file in using file(), then found the string length, used substr() to get rid of the first double quote in the line

Re: [PHP] fgetcsv or other

2002-10-12 Thread @ Edwin
Hello, Just remember that fgetcsv() returns an array. So the first column is $thearray[0]; You can just pass it to the function that generates the image BEFORE you go to the next line of your csv file. Or, am I missing something? - E On Saturday, October 12, 2002 2:05 AM Bryan Koschmann

RE: [PHP] fgetcsv

2001-05-13 Thread Jason Murray
Hi all - just wondering if anyone knows of a function like fputcsv - that is, writes a line to a csv file - opposite of fgetcsv. A CSV file is just a text file with a different file extension, so you can use fgets to write it out... Jason -- PHP General Mailing List (http://www.php.net/)