[thelist] Excel to PHP?

Ken Moore cor412 at hotmail.com
Sat Sep 20 08:34:35 CDT 2003


Thanks Kelly,

Actually, I want to read all elements into an array but this will work. I am 
writing an amortized loan routine and need to have 1,200 values ready. Not 
too difficult for a database programmer but I am new to PHP.

Thanx again.

Ken - Who believes that HTML et cetera qualifies as programming.


: 20 Sep 2003 04:20:30.0850 (UTC) FILETIME=[871C2E20:01C37F2E]
>
>On Sat, 20 Sep 2003, Ken Moore wrote:
> > This may be a tough one.
>
>Not that tough to meet your stated requirement, if you're willing to take
>an extra step and save a delimited file...
>
> > I have a 40 cell by 30 cell set of numbers in Excel and I want to put
> > them into an array in PHP.
>
>Export/save spreadsheet as a tab-delimited file and use PHP similar to:
>
># (Untested, but I'm confident...)
>$xl = file("delimited.txt");
>foreach($xl as $row) { $data[] = explode("\t",$row); }
>echo $data[$row][$col];
>
>Now, if you want to read an .xls file, that's not going to be so easy.
>
>--
>Kelly Hallman
>http://wrack.org/

_________________________________________________________________
Frustrated with dial-up? Get high-speed for as low as $29.95/month 
(depending on the local service providers in your area).  
https://broadband.msn.com



More information about the thelist mailing list