QAds
12 Ay Taksit
Canon Digital Rebel XT 8MP Digital SLR Camera with EF-S 18-55mm f3.5-5.6 Lens
$254.25
Motorola RIZR Z8 Ferrari Quad-Band, 2 MP Camera, MP3 Player and MicroSD Slot
$194.99
Sony Ericsson T715 Slider 3G Phone in Rouge Pink
$149.96
Samsung SL30 10MP Digital Camera with 3x Optical Zoom and 2.5 inch LCD
$69.74
:: HOME » PHP » How To Read Excel File
 
How To Read Excel File

If you want to read an excel file with PHP you can use script below.

I want to explain how to use it. at first, copy codes below and paste in PHP file.

 

you just need to include reader.PHP file into your code :

require_once 'reader.PHP';

 

dont forget that reader.PHP file requires oleread.inc file.

after that  you need to describe class and then read the file:

    $data = new Spreadsheet_Excel_Reader();
    $data->setOutputEncoding('CP1251');
    $data->read('myExcelFile.xls');

thats it. After that you can start to read your excel file:

$data->sheets[1]['cells'][2][3];

by this way you can read any cell from excel file. what you need to determine which sheet, which row and which column.

$data->sheets[SHEET]['cells'][ROW][COLUMN];

you need to put 0 for first sheet, 1 for second sheet. 1 for first row of sheet and 1 for first column of row.

 

thats it

 

oleread.inc file

www.bounmis.com/files/oleread.inc.txt

 

reader.PHP file

 www.bounmis.com/files/reader.txt


PHP How To Read Excel File PHP How To Read Excel File PHP How To Read Excel File
PHP How To Read Excel File
NEW QUESTION
 
Your E-Mail Address
»
Your e-mail will never be shown!  
   
 
Question
»
Please type your question and please use [CODE] tag for your codes!  
  Add CODE Quote BOLD ITALIC Underline Align Left Align Center Align Right Add Line  
   
 
Human Check
»
Enter human check code below!  
   
 
       
 
* Your Question will be answered as soon as possible, probably within 24 hours!
PHP How To Read Excel File PHP How To Read Excel File PHP How To Read Excel File
PHP How To Read Excel File
 
Website Designer, Search Engine Optimization Expert, Ajax Developer,Developed And Designed By Mumin Celik With Using PHP, MySQL, CSS, JavaScript, Ajax And Search Engine Optimizer Sinema ve Film Rehberi Sudoku Oyunu