NYCPHP Meetup

NYPHP.org

[nycphp-talk] CSV/XML

jon baer jonbaer at jonbaer.net
Thu Sep 25 08:48:45 EDT 2003


speaking of which, a simple fgetxml function would be pretty cool ...

how id picture it working (without attributes):

$handle = fopen("file.xml", "r");
while ($sub = fgetxml($handle, "<root>")) {
     print "$sub[name] $sub[url]";
}

<root>
   <name>NYPHP</name>
   <url>http://www.nyphp.org</url>
</root>

as for CVS/MYSQL use the syntax LOAD DATA INFILE as described here (keep in
mind it is a SQL query so you can use PHP to do it):

http://www.mysql.com/doc/en/LOAD_DATA.html

- jon

----- Original Message -----
From: "Alexander Chan" <alexander_chan at yahoo.com>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Wednesday, September 24, 2003 10:51 PM
Subject: Re: [nycphp-talk] CSV


> i would recommend using fgetcsv function should help
> you.
> if you goto http://us3.php.net/fgetcsv there is an
> example for you.
>
> Alex
> --- "Donald J. Organ IV" <dorgan at optonline.net> wrote:
> > what would be the best way to go about letting the
> > user insert a csv file
> > into a mysql database and also letting the user
> > extract certain information
> > from the server into a csv file.
> >
> > _______________________________________________
> > talk mailing list
> > talk at lists.nyphp.org
> > http://lists.nyphp.org/mailman/listinfo/talk
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>




More information about the talk mailing list