codice:
$nome="ciao.trk"; 
// nel tuo caso dovrebbe essere $_FILES['img1']['name']
if (substr($nome,-3) == "trk"){
	//OK
} else {
	//NON PERMESSO;
}