Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   PHP (https://www.clubdelphi.com/foros/forumdisplay.php?f=15)
-   -   PHP importar excel xslx (https://www.clubdelphi.com/foros/showthread.php?t=96301)

Jose Manuel 16-07-2023 13:25:22

PHP importar excel xslx
 
Hola, tengo un problema al importar archivos *.xlsx. En local utilizo XAMPP Version: 7.2.7 y me funciona correctamente pero al pasarlo al servidor remoto, no me funciona. He probado con otras librerías y me pasa lo mismo.

Este código me funciona en local y en remoto, pero si cambio el fichero xls por otro xlsx, solo me funciona en local.

Código PHP:

<?php
require_once 'phpexcel/Classes/PHPExcel.php';
$archivo 'subidas/fichero.xls';
$inputFileType PHPExcel_IOFactory::identify($archivo);
$objReader PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel $objReader->load($archivo);
$sheet $objPHPExcel->getSheet(0); 
$highestRow $sheet->getHighestRow(); 
$highestColumn $sheet->getHighestColumn();

for (
$row 2$row <= $highestRow$row++){ 
        echo 
$sheet->getCell("A".$row)->getValue()." – ";
        echo 
$sheet->getCell("B".$row)->getValue()." – ";
        echo 
$sheet->getCell("C".$row)->getValue();
        echo 
"<br>";
}



La franja horaria es GMT +2. Ahora son las 09:13:11.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi