Php 如何使用下拉列表生成表?
对于我的系统,当我从Departments(下拉列表)中选择一个部门名称和从Programs(下拉列表)中选择一个程序名称时,它应该在php中生成一个读取表格的ax excel文件。我试着只读取一个excel文件,它就工作了。如何在PHP和MySQL中将选择与下面的文件连接 我找到的读取excel文件的代码如下: 读取Excel文件Php 如何使用下拉列表生成表?,php,excel,Php,Excel,对于我的系统,当我从Departments(下拉列表)中选择一个部门名称和从Programs(下拉列表)中选择一个程序名称时,它应该在php中生成一个读取表格的ax excel文件。我试着只读取一个excel文件,它就工作了。如何在PHP和MySQL中将选择与下面的文件连接 我找到的读取excel文件的代码如下: 读取Excel文件 <?php include 'reader.php'; $excel = new Spreadsheet_Excel_Reader();
<?php
include 'reader.php';
$excel = new Spreadsheet_Excel_Reader();
?>
Sheet 1:<br/><br/>
<table border="1">
<?php
$excel->read('prog.xls'); // set the excel file name here
$x=1;
while($x<=$excel->sheets[0]['numRows']) { // reading row by row
echo "\t<tr>\n";
$y=1;
while($y<=$excel->sheets[0]['numCols']) {// reading column by column
$cell = isset($excel->sheets[0]['cells'][$x][$y]) ? $excel->sheets[0]['cells'][$x][$y] : '';
echo "\t\t<td>$cell</td>\n"; // get each cells values
$y++;
}
echo "\t</tr>\n";
$x++;
}
?>
</table><br/>
第1页: