I'm trying to do a scandir of a directory that will be filtered by a variable that contains the filename (without the extension) but I have no idea how to accomplish this, here's an example:
$nome = $_POST["imgname"];//nome do arquivo recebido pelo post
$dir = "pasta/img/";//Local onde o arquivo está salvo
$arquivo = scandir($dir);//Pedaço que gostaria de modificar para filtrar pelo $nome
OBS: I'm doing the scandir to get the file extension because as I said above the variable $nome
has no extension, if there is another way to get the full name of the specified file would help a lot too !