How to import an excel file as the cells in TEXT format
code
$file_tmp = $_FILES['arquivo']['tmp_name'];
try {
$FileType = PHPExcel_IOFactory::identify( $file_tmp );
$objReader = PHPExcel_IOFactory::createReader( $FileType );
$objReader->setReadDataOnly( true );
$objPHPExcel = $objReader->load( $file_tmp );
}catch( Exception $e ){
die( $e->getMessage() );
}
$objWorksheet = $objPHPExcel->getActiveSheet();
$fimColuna = $objWorksheet->getHighestColumn();
$numero_de_linhas = $objWorksheet->getHighestRow();
$numero_de_colunas = PHPExcel_Cell::columnIndexFromString( $fimColuna );
for( $row = 0; $row <= $numero_de_linhas; $row++ ){
$data = array();
for( $col = 0; $col < $numero_de_colunas; $col++ ){
$data[] = $objWorksheet->getCellByColumnAndRow($col, $row)->getValue();
}
}
The way the dates in the format 11/12/2014 //MÊS/DIA/ANO
looks like this: 41984.69211805556
Thank you in advance for the help.