How to opening excel files in windows nad linux using php ?
Top Questions
if you're using PHP on Windows, you can use the inbuilt COM library
$excel = new COM("excel.application");
$excel->Workbooks->Open("filename.xls");
On Linux machines, is PHPExcelReader( download from sourceforgr.net), and it seems to work very efficiently and easily with only a few lines of code.
$data = new Spreadsheet_Excel_Reader();
$data->read("filename.xls");
And you can access the data with a simple loop:
for($i=1; $i <= $data->sheets[0]['numRows']; $i++)
{
echo 'Row '. $i .', Column a:' $data->sheets[0]['cells'][$i][1] . '<br />';
echo 'Row '. $i .', Column b:' $data->sheets[0]['cells'][$i][2] . '<br />';
}
Chevrolet Cruze Miami
Really appreciate this post. It's hard to sort the good from the bad sometimes, but I think you've nailed it!
Post new comment