2017-02-27 2 views

Antwort

0

Dazu müssen Sie eine Drittanbieter-Bibliothek wie SimpleExcel verwenden.

eine Excel 2003-XML-Datei parsen, vereinfacht:

<?php 

use SimpleExcel\SimpleExcel; 

require_once('../your/project/directory/here/lib/SimpleExcel/SimpleExcel.php'); // load the main class file (if you're not using autoloader) 

$excel = new SimpleExcel('xml');     // instantiate new object (will automatically construct the parser & writer type as XML) 

$excel->parser->loadFile('example.xml');   // load an XML file from server to be parsed 

$foo = $excel->parser->getField();     // get complete array of the table 
$bar = $excel->parser->getRow(3);     // get specific array from the specified row (3rd row) 
$baz = $excel->parser->getColumn(4);    // get specific array from the specified column (4th row) 
$qux = $excel->parser->getCell(2,1);    // get specific data from the specified cell (2nd row in 1st column) 

echo '<pre>'; 
print_r($foo);          // echo the array 
echo '</pre>'; 
?> 

Reference

+0

Können Sie bitte ist die Lösung @Mayank Pandeyz –

+0

Hallo alle Problem gelöst erarbeiten! Ich benutzte die PHPExcel Bibliothek, um die Zeilen von der ** xlsx ** Datei in die ** sqlite ** Datenbank zu importieren. Ich nahm Hilfe von hier: [link] (http://www.discussdesk.com/import-excel-file- Daten-in-Mysql-Datenbank-Verwendung-PHP.htm) –

Verwandte Themen