3
How to import an excel file as 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();
}
}
As the dates are in format 11/12/2014 //MÊS/DIA/ANO
get like this: 41984.69211805556
Thanks in advance for the help.
Separate the text that solved the problem and creates an answer with it, don’t mix that with the question.
– rray
@lost, done!
– smigol