Re: fgetcsv Help
| From: | @ Edwin | Date: | Thu, 12 Dec 2002 16:31:54 +0000 |
| Subject: | Re: fgetcsv Help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-128033@lists.php.net to get a copy of this message | ||
Hello,
"Justin French" <justin@indent.com.au> 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 aren't really necessary unless
1. You have a comma in the field
2. You have double quotes in the field
So,
1,foo,"Harry said ""what is it""",foo
would have no problem with fgetcsv().
And, btw, the " are also "escaped" with another ".
- E