I try to read a spreadsheet however when there is only numbers in a cell, it puts them as .0
digits, ie, if the cell value is 123
, it reads it as 123.0
int. Is there a way to read them as raw string?
try {
$inputFileType = IOFactory::identify($path);
try {
$reader = IOFactory::createReader($inputFileType);
$reader->setReadDataOnly(true);
$valuesSpreadsheet = $reader->load($path);
try {
$spreadsheetArr = $valuesSpreadsheet->getActiveSheet()->toArray();
dd($spreadsheetArr);
}
}
}
So output is like
$arr = ['A', 'B', 123.0]
and what I want to achieve is
$arr = ['A', 'B', '123']