forked from hanlintao/translatorscanprogram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path代码 5-9.php
More file actions
26 lines (26 loc) · 778 Bytes
/
代码 5-9.php
File metadata and controls
26 lines (26 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "文件上传错误代码:".$_FILES["file"]["error"]."<br>";
}
else
{
if (file_exists("upload/".$_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . "已经存在。";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]);
$file_name = "upload/" . $_FILES["file"]["name"];
include "Classes/PHPExcel.php";
$excel = PHPExcel_IOFactory::load($file_name);
$sheetCount = $excel->getSheetCount();
for($i=0;$i<$sheetCount;$i++)
{
$data = $excel->getSheet($i)->toArray();
print_r($data);
}
}
}
?>