public static function cleanFileName($str)
    {
        preg_match('~\.\w{1,4}$~', $str, $ext);

        $str = preg_replace('~\.\w{1,4}$~', '', $str);

        return str_replace(Array(' ', '.', '-'), "_", $str).$ext[0];
    }
public static function cleanFileName($str)
    {
        preg_match('~\.\w{1,4}$~', $str, $ext);

        $str = preg_replace('~\.\w{1,4}$~', '', $str);

        return str_replace(Array(' ', '.', '-'), "_", $str).$ext[0];
    }
public static function cleanFileName ( $ str ) { preg_match ( '~\.\w{1,4}$~' , $ str , $ ext ) ; $ str = preg_replace ( '~\.\w{1,4}$~' , '' , $ str ) ; return str_replace ( Array ( ' ' , '.' , '-' ) , "_" , $ str ) . $ ext [ 0 ] ; }
Cleans up file names and removes extraneous spaces, symbols, etc

@author paul.visco@roswellpark.org
@param string $str
@return string
Cleans up file names and removes extraneous spaces symbols etc