I'm trying to compare the length of a file, but it's failing I created a variable with the extensions allowed and try to compare with the one being uploaded.
// Lista de tipos de arquivos permitidos
$tiposPermitidos = array('gif', 'jpeg', 'jpeg', 'png');
$infos = pathinfo($rowData['imagem']);
$arqType = $infos['extension'];
if (in_array($arqType, $tiposPermitidos)) {
echo 'O tipo de arquivo enviado é inválido, permitido somente imagens';
}
Running a var_dump($infos);
I get the following result:
array(4) { ["dirname"]=> string(9) "../banner" ["basename"]=> string(9) "10889.php" ["extension"]=> string(3) "php" ["filename"]=> string(5) "10889" }