gundambison

abaikan saja

Sep 1st, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2. //males mode on
  3.  
  4. $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName);
  5.  
  6.  
  7.         $huruf = array(
  8.             'b',
  9.             'c',
  10.             'd'
  11.         ); //maaf lagi males
  12.         $max   = 20;
  13.         $n20   = 0;
  14.         $res   = array();
  15.         foreach ($huruf as $n) {
  16.             for ($i = 1; $i <= $max; $i++) {
  17.                 $cell = strtoupper($n . $i);
  18.                 $col  = $spreadsheet->getActiveSheet()->getStyle($cell)->getFont()->getColor()->getRGB();
  19.                 $txt  = $spreadsheet->getActiveSheet()->getCell($cell)->getValue();
  20.                 if ($col == 'FF3333') {
  21.                     if (!isset($res[$txt]))
  22.                         $res[$txt] = 0;
  23.                     $res[$txt]++;
  24.                 }
  25.                 //FF3333
  26.             }
  27.         }
  28.        
  29. print_r($res);
Advertisement
Add Comment
Please, Sign In to add comment