Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用下拉列表生成表?_Php_Excel - Fatal编程技术网

Php 如何使用下拉列表生成表?

Php 如何使用下拉列表生成表?,php,excel,Php,Excel,对于我的系统,当我从Departments(下拉列表)中选择一个部门名称和从Programs(下拉列表)中选择一个程序名称时,它应该在php中生成一个读取表格的ax excel文件。我试着只读取一个excel文件,它就工作了。如何在PHP和MySQL中将选择与下面的文件连接 我找到的读取excel文件的代码如下: 读取Excel文件 <?php include 'reader.php'; $excel = new Spreadsheet_Excel_Reader();

对于我的系统,当我从Departments(下拉列表)中选择一个部门名称和从Programs(下拉列表)中选择一个程序名称时,它应该在php中生成一个读取表格的ax excel文件。我试着只读取一个excel文件,它就工作了。如何在PHP和MySQL中将选择与下面的文件连接

我找到的读取excel文件的代码如下:

读取Excel文件

<?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页: