J'ai un fichier excel à lire, et pour cela j'utilise PHP Excel qui semble très bien, mais je rencontre un problème bizarre. Quand je lance le script suivant :
Code : Tout sélectionner
<?php
require_once './Classes/PHPExcel/IOFactory.php';
// Chargement du fichier Excel
$objPHPExcel = PHPExcel_IOFactory::load("rapportsimple.xls");
/**
* récupération de la première feuille du fichier Excel
* @var PHPExcel_Worksheet $sheet
*/
$sheet = $objPHPExcel->getSheet(0);
echo '<table border="1">';
// On boucle sur les lignes
foreach($sheet->getRowIterator() as $row) {
echo '<tr>';
// On boucle sur les cellule de la ligne
foreach ($row->getCellIterator() as $cell) {
echo '<td>';
print_r($cell->getValue());
echo '</td>';
}
echo '</tr>';
}
echo '</table>';
?>
DOM ELEMENT: HTML
ATTRIBUTE: xmlns => http://www.w3.org/1999/xhtml
DOM ELEMENT: HEAD
DOM ELEMENT: META
ATTRIBUTE: http-equiv => Content-Type
ATTRIBUTE: content => text/html; charset=utf-8
DOM ELEMENT: BODY
DOM ELEMENT: DIV
ATTRIBUTE: id => dnn_ctr470_ViewPDFReport_RapportSimpleGrid_GridData
ATTRIBUTE: class => GridDataDiv_Sedifleet
ATTRIBUTE: style => overflow:auto;width:100%;height:300px;
STYLING, SPAN OR DIV
..........
Seulement après ses lignes mon tableau s'affiche. On a l'impression qui c'est l'include IOFactory.ph qui affiche ses informations, mais je n'en voudrais pas. Avez vous une idée pour retirer cela et ne n'afficher que le tableau
Merci d'avance