public static function getFileExtension($fileName, $asLowerCase = false)
    {
        $extension = '';
        $matches = [];

        if (preg_match('|(.+)\.(.+)|', $fileName, $matches)) {
            $extension = end($matches);
        }

        if ($asLowerCase) {
            return strtolower($extension);
        }

        return $extension;
    }