public function cleanKey($key)
    {
        return is_string($key) && file_exists(trim($key))
            ? preg_replace('/\.[^.]+$/', '', basename($key))
            : $key;
    }
public function cleanKey($key)
    {
        return is_string($key) && file_exists(trim($key))
            ? preg_replace('/\.[^.]+$/', '', basename($key))
            : $key;
    }
public function cleanKey ( $ key ) { return is_string ( $ key ) && file_exists ( trim ( $ key ) ) ? preg_replace ( '/\.[^.]+$/' , '' , basename ( $ key ) ) : $ key ; }
Clean the array key.

@param $key

@return mixed|string
Clean the array key .