Re: pulling data out of a text file
| From: | Richard Lynch | Date: | Thu, 28 Dec 2000 04:35:48 +0000 |
| Subject: | Re: pulling data out of a text file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32048@lists.php.net to get a copy of this message | ||
> $row[0]= $domain;
All these are backwards... You want $domain = $row[0];
Also, if this is a true CSV file, your explode will not work when you hit a
field with a comma embedded in it:
zend.com,"Zend Technologies, LTD",Richard,Lynch,...
is valid CSV, but you're going to get all messed up by those quotes and
embedded comma in the Company.
Fortunately, there's a builtin PHP function for reading CSV files. See the
file system section of the manual.
> $row[1]=$tld;
> $row[2]=$company;
> $row[3]=$firstname;
> $row[4]=$lastname;
> $row[5]=$address;
> $row[6]=$zip;
> $row[7]=$city;
> $row[8]=$telephone;
> $row[9]=$fax;
> $row[10]=$email;
> $row[11]=$package;
> $row[12]=$frontpage;
> $row[13]=$mysql;
> $row[14]=$change_registrar;
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>