Click to See Complete Forum and Search --> : How can I read data from MsExcell files?
Hi guys, I'm a novice in php, and i've got some Microsoft Excell files for my site.
How can I get data from these files, for my dynamic stats?
Thanks
Marco Bertolotti
Hi!
How about using ODBC connection? I actually have never used ODBC together with Excell, but I think it is possible. Just set the (System) DSN for the Excell file. And use the ODBC functions in PHP.
Hope this helps
-ARi
Can you export the files into comma seperated text files? php can access them quite easily...is that an option?
---John Holmes...
how to use php to access the CSV file?
could you tell me?
Just use file() or fopen(). read in a line, explode by "," and then you have your data. File() is easiest...
Use this:
$filename = "blah.txt";
$file = file($filename);
for($count=0;$count<count($file);$count++)
{
$line = explode(",",$file[$count]);
//$line will be an array containing
//each value that was seperated by a comma
echo $line[0];
echo $line[1];
}
Adapt to your needs, of course.
---John Holmes...
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.