What something like this?

````
if (count($tmp) >= 2 && ($module = strtolower($tmp[0])) && isset($files[$module])) {
	return $module;
}
    
return $files[0];
````