[thelist] Excel to PHP?

Kelly Hallman khallman at wrack.org
Fri Sep 19 23:18:18 CDT 2003


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/



More information about the thelist mailing list