informatica:programacion:php:simplexlsx
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
| informatica:programacion:php:simplexlsx [2025/01/23 09:43] – [SimpleXLSX] tempwin | informatica:programacion:php:simplexlsx [2025/01/23 10:33] (actual) – [SimpleXLSX] tempwin | ||
|---|---|---|---|
| Línea 1: | Línea 1: | ||
| ====== SimpleXLSX ====== | ====== SimpleXLSX ====== | ||
| - | Clase de [[informatica: | + | Clase de [[informatica: |
| * [[https:// | * [[https:// | ||
| + | |||
| + | <WRAP center round info 60%> | ||
| + | Desde 2006-2007, Microsoft empezó a usar el formato [[https:// | ||
| + | </ | ||
| ===== Uso ===== | ===== Uso ===== | ||
| Línea 9: | Línea 13: | ||
| <code php> | <code php> | ||
| use Shuchkin\SimpleXLSX; | use Shuchkin\SimpleXLSX; | ||
| + | |||
| + | // Ruta a la clase | ||
| + | require_once __DIR__.'/ | ||
| if ( $xlsx = SimpleXLSX:: | if ( $xlsx = SimpleXLSX:: | ||
| Línea 16: | Línea 23: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | ==== Seleccionar una hoja ==== | ||
| + | |||
| + | <code php> | ||
| + | use Shuchkin\SimpleXLSX; | ||
| + | |||
| + | // Ruta a la clase | ||
| + | require_once __DIR__.'/ | ||
| + | |||
| + | $xlsx = SimpleXLSX:: | ||
| + | foreach( $xlsx-> | ||
| + | | ||
| + | } | ||
| + | </ | ||
| + | ==== Fichero XLSX a tabla HTML ==== | ||
| + | |||
| + | <code php> | ||
| + | use Shuchkin\SimpleXLSX; | ||
| + | |||
| + | // Ruta a la clase | ||
| + | require_once __DIR__.'/ | ||
| + | |||
| + | if ( $xlsx = SimpleXLSX:: | ||
| + | echo $xlsx-> | ||
| + | } else { | ||
| + | echo SimpleXLSX:: | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Fichero XSLX a CSV ==== | ||
| + | |||
| + | <code php> | ||
| + | use Shuchkin\SimpleXLSX; | ||
| + | |||
| + | // Ruta a la clase | ||
| + | require_once __DIR__.'/ | ||
| + | |||
| + | if ( $xlsx = SimpleXLSX:: | ||
| + | $f = fopen(' | ||
| + | // fwrite($f, chr(0xEF) . chr(0xBB) . chr(0xBF)); // UTF-8 BOM | ||
| + | foreach ( $xlsx-> | ||
| + | fputcsv($f, $r); | ||
| + | // Para Excel en español: | ||
| + | // fputcsv($f, $r, ';', | ||
| + | } | ||
| + | fclose($f); | ||
| + | } else { | ||
| + | echo SimpleXLSX:: | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Obtener el nombre de las hojas y su posición ==== | ||
| + | |||
| + | <code php> | ||
| + | use Shuchkin\SimpleXLSX; | ||
| + | |||
| + | // Ruta a la clase | ||
| + | require_once __DIR__.'/ | ||
| + | |||
| + | // Las hojas se empiezan a contar desde el 0 | ||
| + | if ( $xlsx = SimpleXLSX:: | ||
| + | print_r( $xlsx-> | ||
| + | print_r( $xlsx-> | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Información del fichero ==== | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
informatica/programacion/php/simplexlsx.1737621791.txt.gz · Última modificación: por tempwin
