1
The LIMITE_SUPERIOR field is of the real type. I’d like to know how to tell him that if it’s empty fill in the number 0 field and when it’s not empty can fill in the number he found inside the database.
$examesEquipamentos = [];
foreach ($csv as $linha) {
$examesEquipamentosId = trim($linha['ID']) . '-' . trim($linha['ID_TR']);
if (!array_key_exists($examesEquipamentosId, $examesEquipamentos)) {
$examesEquipamentos[$examesEquipamentosId] = [
'ID' => trim($linha['ID']),
'NOME_PARAMETRO' => trim($linha['NOME_PARAMETRO']),
'ID_TR' => trim($linha['ID_TR']),
'TR_NOME' => trim(mb_strtoupper($linha['TR_NOME'])),
'UNIDADE_RESULTADO' => trim($linha['UNIDADE_RESULTADO']),
'CATEGORIA_RESULTADO' => trim($linha['CATEGORIA_RESULTADO']),
'LIMITE_INFERIOR' => trim($linha['LIMITE_INFERIOR']),
'LIMITE_SUPERIOR' => trim($linha['LIMITE_SUPERIOR']),
];
}
}
I did not understand well, in case it returns null or empty want to be returned 0 ?
– Bulfaitelo
@Gladiator If he’s a
float
why are you givingtrim()
in it? It’s a string, no?– fernandosavio
he takes the value from the csv. file and this csv has field with filled and empty fields. so at times of returning the empty fields wanted to put zero in place instead of returning me an empty field
– Gladiador