load("../sdm_business_code.xlsx"); $sheetCount = $objPHPExcel->getSheetCount(); $exportData = function ($sheetCount) use($objPHPExcel) { $businessCode = []; for ($i=0; $i<$sheetCount; $i++){ $sheet = $objPHPExcel->getSheet($i); $businessCode[$i]["sheet_name"] = $sheet->getTitle(); foreach($sheet->getRowIterator() as $key => $row) { $cellIterator = $row->getCellIterator(); $cellIterator->setIterateOnlyExistingCells(true); foreach ($cellIterator as $cell) { if ($key > 1) { $columnValue = (string)$cell->getValue(); $businessCode[$i]["data"][$key-2][] = $columnValue; } } } } return $businessCode; }; $data = $exportData($sheetCount); } public function testTimes() { $timed = date("ymdhm", time()); } public function testMd5() { $m = md5("123", true); } public function testGuid() { // if (function_exists('com_create_guid') === true) { // $guid = strtolower(str_replace('-', '', trim(com_create_guid(), '{}'))); // } // // $guid = sprintf('%04x%04x%04x%04x%04x%04x%04x%04x', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535)); $str = md5(uniqid(mt_rand(), true)); $uuid = substr($str,0,8); $uuid .= substr($str,8,4); $uuid .= substr($str,12,4); $uuid .= substr($str,16,4); $uuid .= substr($str,20,12); } }