fichier = $fichierExcel; $this->lecteur = new Spreadsheet_Excel_Reader(); $this->lecteur->setUTFEncoder('mb'); $this->lecteur->setOutputEncoding('UTF-8'); $this->lecteur->read($this->fichier); } public function getFichier() { return $this->fichier; } public function getFeuille() { return $this->feuille; } public function setFeuille($feuille) { return $this->feuille = $feuille; } public function getValeur($ligne, $colonne) { $val = $this->lecteur->val($ligne, $colonne, $this->feuille); return $val; } public function getValeurBrute($ligne, $colonne) { return $this->lecteur->raw($ligne, $colonne, $this->feuille); } public function getNbreLignes() { return $this->lecteur->rowcount($this->feuille); } public function getNbreColonne() { return $this->lecteur->colcount($this->feuille); } public function getDonnees() { return $this->lecteur->sheets[$this->feuille]; } public function afficherTxt() { foreach ($this->lecteur->sheets as $k => $data) { echo "Fichier : {$this->fichier}.\nFeuille $k\n"; foreach ($data['cells'] as $idRow => $row) { foreach ($row as $idCol => $cell) { echo $this->getValeur($idRow, $idCol)."\t"; } echo "\n"; } } } } ?>