Created
December 2, 2021 11:52
-
-
Save erowsika/f6db207328a42f1ff9005f14d8fbee89 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('memory_limit', '512M'); | |
$inputFileName = public_path('mutasi.xlsx'); | |
/** Identify the type of $inputFileName **/ | |
$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($inputFileName); | |
/** Create a new Reader of the type that has been identified **/ | |
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); | |
/** Load $inputFileName to a Spreadsheet Object **/ | |
$spreadsheet = $reader->load($inputFileName); | |
/** Convert Spreadsheet Object to an Array for ease of use **/ | |
$schdeules = $spreadsheet->getActiveSheet()->toArray(); | |
foreach( $schdeules as $single_schedule ) | |
{ | |
echo '<div class="row">'; | |
foreach( $single_schedule as $single_item ) | |
{ | |
echo '<p class="item">' . $single_item . '</p>'; | |
} | |
echo '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment