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

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 13 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Check It !

Tweet It

W3 Updates

Stay informed on our latest news!

Syndicate content