I have an upload system from which to upload a file with this type of nomenclature:
Law 4,472 - 2015 - Amends Law 4,000 of July 10, 2013 - Particular Archive.pdf
I'm removing the spaces and accents as follows:
$arquivo = $_FILES["Arquivo"]['name'];
$extensao = pathinfo($arquivo);
$extensao = $extensao['extension'];
list($nomeArquivo,$extensaoArquivo) = explode(".".$extensao,$arquivo);
$novoNome = strtolower( preg_replace("[^a-zA-Z0-9-.]", "-", strtr(utf8_decode(trim($nomeArquivo)), utf8_decode("áàãâéêíóôõúüñçÁÀÃÂÉÊÍÓÔÕÚÜÑÇ."), "aaaaeeiooouuncAAAAEEIOOOUUNC-")) );
$arquivo $novoNome.".".$extensao;
But when the file has º
, the ?
sign appears. How can I fix this by making this sign also hyphenated?