title: how to read specific row from excel file to display information on html output using PHP code?
body: <p>how to read specific row from excel file to display information on html output  using PHP code?    </p>
  
  <pre><code>&lt;?php
  include 'excel_reader.php';     // include the class
  
  // creates an object instance of the class, and read the excel file data
  $excel = new PhpExcelReader;
  $excel-&gt;read('fees.xls');
  
  // Excel file data is stored in $sheets property, an Array of worksheets
  /*
  The data is stored in 'cells' and the meta-data is stored in an array called 'cellsInfo'
  
  Example (firt_sheet - index 0, second_sheet - index 1, ...):
  
  $sheets[0]  --&gt;  'cells'  --&gt;  row --&gt; column --&gt; Interpreted value
           --&gt;  'cellsInfo' --&gt; row --&gt; column --&gt; 'type' (Can be 'date', 'number', or 'unknown')
                                              --&gt; 'raw' (The raw data that Excel stores for that data cell)
  */
  
  // this function creates and returns a HTML table with excel rows and columns data
  // Parameter - array with excel worksheet data
  function sheetData($sheet) {
    $re = '&lt;table&gt;';     // starts html table
  
    $x = 1;
    while($x &lt;= $sheet['numRows']) {
      $re .= "&lt;tr&gt;\n";
      $y = 1;
      while($y &lt;= $sheet['numCols']) {
        $cell = isset($sheet['cells'][$x][$y]) ? $sheet['cells'][$x][$y] : '';
        $re .= " &lt;td&gt;$cell&lt;/td&gt;\n";  
        $y++;
      }  
      $re .= "&lt;/tr&gt;\n";
      $x++;
    }
  
    return $re .'&lt;/table&gt;';     // ends and returns the html table
  }
  
  $nr_sheets = count($excel-&gt;sheets);       // gets the number of sheets
  $excel_data = '';              // to store the the html tables with data of each sheet
  
  // traverses the number of sheets and sets html table with each sheet data in $excel_data
  for($i=0; $i&lt;$nr_sheets; $i++) {
    $excel_data .= '&lt;h4&gt;Sheet '. ($i + 1) .' (&lt;em&gt;'. $excel-&gt;boundsheets[$i]['name'] .'&lt;/em&gt;)&lt;/h4&gt;'. sheetData($excel-&gt;sheets[$i]) .'&lt;br/&gt;';  
  }
  ?&gt;
  &lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;Example PHP Excel Reader&lt;/title&gt;
    &lt;style type="text/css"&gt;
      table {
        border-collapse: collapse;
      }        
      td {
        border: 1px solid black;
        padding: 0 0.5em;
      }        
    &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;?php
      // displays tables with excel file data
      echo $excel_data;enter code here
    ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>