01.
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
>
02.
<html>
03.
<head>
04.
<title>Test Reader Excel</title>
05.
<meta http-equiv=Content-Type content=
"text/html; charset=utf-8"
>
06.
</head>
07.
08.
<body>
09.
10.
<?php
11.
require_once
'Excel/reader.php'
;
12.
13.
14.
$data
=
new
Spreadsheet_Excel_Reader();
15.
16.
17.
$data
->setOutputEncoding(
'utf-8'
);
18.
19.
$data
->setUTFEncoder(
'iconv'
);
20.
21.
$data
->read(
'Excel_file/GradeForm.xls'
);
22.
23.
error_reporting
(E_ALL ^ E_NOTICE);
24.
?>
25.
26.
<table width=
"700"
border=
"1"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
>
27.
28.
<?php
29.
for
(
$i
= 1;
$i
<=
$data
->sheets[0][
'numRows'
];
$i
++) {
30.
echo
"<tr>"
;
31.
for
(
$j
= 1;
$j
<=
$data
->sheets[0][
'numCols'
];
$j
++) {
32.
echo
"<td>"
;
33.
34.
35.
36.
37.
echo
$data
->sheets[0][
'cells'
][
$i
][
$j
];
38.
39.
40.
if
(
$i
== 1){
41.
echo
$field
;
42.
}
43.
echo
"<input name='field"
.
$i
.
$j
.
"' type='hidden' value='"
.
$data
->sheets[0]['cells
'][$i][$j]."'
size=
'3'
>";
44.
echo
"</td>"
;
45.
}
46.
echo
"</tr>"
;
47.
}
48.
49.
50.
?>
51.
52.
</table>
53.
54.
</body>
55.
</html>