This is a practical PHP tutorial using Excelfileparser to import Excel into the database tutorial Oh.
Excel Data Capture Demo
Excel Data Capture Demo
parese.php file
/**
* Copyright (c) 2009,
* All rights reserved.
FileName
Summary
*
* @author Week VIII [Url=mailto:ixqbar@hotmail.com]ixqbar@hotmail.com[/url]
* @version
*/
Public Function Parse ()
{
/**
* $_files Array description
* Array (n) {
* ["Form file box name"] = = Array (5) {
* ["name"] + = Submit file name
* ["type"] = + Submit file type Excel for "Application/vnd.ms-excel"
* ["tmp_name"] + = Temp file name
* ["error"] = + Error (0 Success 1 file too large more than Upload_max_filesize2 file is too large for max_file3 upload incomplete 4 not uploaded file)
* ["size"] + = File size (in KB)
* }
* }
*/
$return =array (0, ');
/**
* Determine whether to submit
* Is_uploaded_file (file name) is used to determine whether the specified file is uploaded using the Post method, prevents illegal submissions, and is usually used with Move_upload_file to save the uploaded file to the specified path
*/
if (!isset ($_files) | |!is_uploaded_file ($_files[' Excel ' [' Tmp_name ']))
{
$return =array (1, ' submission not lawful ');
}
Processing
if (0 = = $return [0])
{
Import (' @.util.excelparser ');
$excel =new excelparser ($_files[' Excel ' [' Tmp_name ']);
$return = $excel->main ();
}
Output processing
Print_r ($return);
?>
http://www.bkjia.com/PHPjc/630810.html www.bkjia.com true http://www.bkjia.com/PHPjc/630810.html techarticle This is a practical PHP tutorial using Excelfileparser to import Excel into the database tutorial Oh.!doctype HTML Public-//w3c//dtd XHTML 1.0 transitional//en/HTTP www.w3.org/tr/xhtml1/dtd/x ...