so i've got this php file that first creates a csv from an xls then converts it into a 2d array and it prints out good but i dont know how to loop through it
heres is the code
what i want to do is check to see if the key field is in the database and if it isn't then insert it if i can figure out how to loop through the array i can probably figure out the rest
Code
<?php
require_once 'Classes/PHPExcel/IOFactory.php';
$inputFileType = 'Excel5';
$inputFileName = 'Position Accepted Staff by Regi 01302017 - Copy.xls';
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcelReader = $objReader->load($inputFileName);
$loadedSheetNames = $objPHPExcelReader->getSheetNames();
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcelReader, 'CSV');
foreach($loadedSheetNames as $sheetIndex => $loadedSheetName) {
$objWriter->setSheetIndex($sheetIndex);
$objWriter->save($loadedSheetName.'.csv');
}
$file = file_get_contents("Position Accepted Staff by Regi.csv");
$data = array_map("str_getcsv", preg_split('/\r*\n+|\r+/', $file));
print_r($data);
?>