Pagina 2 di 2 primaprima 1 2
Visualizzazione dei risultati da 11 a 12 su 12
  1. #11
    questo è un esempio che ho scritto sul mio blog.
    però parte dal fatto che il file è già sul server, quindi aggiungerci l'upload:
    Codice PHP:
    <?php
    include_once './PHPExcel/IOFactory.php'
    $inputFileName './barre.xls';
    ?>
    <table class="table table-bordered">
        <?php
        
    try {
            
    $inputFileType PHPExcel_IOFactory::identify($inputFileName);
            
    $objReader PHPExcel_IOFactory::createReader($inputFileType);
            
    $phpExcel $objReader->load($inputFileName);
            
    $sheet $phpExcel->getSheet(0);
        } catch (
    Exception $e) {
            echo 
    $e->getMessage();
        }
        
    $highestRow $sheet->getHighestRow();
        
    $highestColumn $sheet->getHighestColumn();
        for (
    $row 1$row <= $highestRow$row++):
            
    $rowData $sheet->rangeToArray('A' $row ':' $highestColumn $rowNULLTRUEFALSE);
            
    ?>
            <tr>
                <?php foreach ($rowData[0] as $col): ?>
                    <td><?php echo $col?></td>
                <?php endforeach; ?>
            </tr>
        <?php endfor; ?>
    </table>
    vedi se può esserti utile!

  2. #12
    Quote Originariamente inviata da fermat Visualizza il messaggio
    questo è un esempio che ho scritto sul mio blog.
    però parte dal fatto che il file è già sul server, quindi aggiungerci l'upload:
    Codice PHP:
    <?php
    include_once './PHPExcel/IOFactory.php'
    $inputFileName './barre.xls';
    ?>
    <table class="table table-bordered">
        <?php
        
    try {
            
    $inputFileType PHPExcel_IOFactory::identify($inputFileName);
            
    $objReader PHPExcel_IOFactory::createReader($inputFileType);
            
    $phpExcel $objReader->load($inputFileName);
            
    $sheet $phpExcel->getSheet(0);
        } catch (
    Exception $e) {
            echo 
    $e->getMessage();
        }
        
    $highestRow $sheet->getHighestRow();
        
    $highestColumn $sheet->getHighestColumn();
        for (
    $row 1$row <= $highestRow$row++):
            
    $rowData $sheet->rangeToArray('A' $row ':' $highestColumn $rowNULLTRUEFALSE);
            
    ?>
            <tr>
                <?php foreach ($rowData[0] as $col): ?>
                    <td><?php echo $col?></td>
                <?php endforeach; ?>
            </tr>
        <?php endfor; ?>
    </table>
    vedi se può esserti utile!
    grazie mille! ci sono riuscito

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.