Skip to content

Instantly share code, notes, and snippets.

@erowsika
Created December 2, 2021 11:52
Show Gist options
  • Save erowsika/f6db207328a42f1ff9005f14d8fbee89 to your computer and use it in GitHub Desktop.
Save erowsika/f6db207328a42f1ff9005f14d8fbee89 to your computer and use it in GitHub Desktop.
<?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