Login   Register  
PHP Classes

File: simplexlsx.example3.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sergey Shuchkin  >  Simple XLSX  >  simplexlsx.example3.php  >  Download  
File: simplexlsx.example3.php
Role: Example script
Content type: text/plain
Description: example: upload & parse
Class: Simple XLSX
Parse and retrieve data from Excel XLS files
Author: By
Last change:
Date: 4 years ago
Size: 721 bytes


Class file image Download

if (isset($_FILES['file'])) {
$xlsx = new SimpleXLSX$_FILES['file']['tmp_name'] );
'<h1>Parsing Result</h1>';
'<table border="1" cellpadding="3" style="border-collapse: collapse">';
$cols,) = $xlsx->dimension();
$xlsx->rows() as $k => $r) {
//        if ($k == 0) continue; // skip first row
echo '<tr>';
$i 0$i $cols$i++)
'<td>'.( (isset($r[$i])) ? $r[$i] : '&nbsp;' ).'</td>';

<form method="post" enctype="multipart/form-data">
*.XLSX <input type="file" name="file"  />&nbsp;&nbsp;<input type="submit" value="Parse" />