public static function containsExtension(string $uri): string
    {
        $pathParts     = explode('/', $uri);
        $filename      = array_pop($pathParts);
        $filenameParts = explode('.', $filename);

        if (count($filenameParts) > 1) {
            return array_pop($filenameParts);
        }

        return '';
    }
public static function containsExtension(string $uri): string
    {
        $pathParts     = explode('/', $uri);
        $filename      = array_pop($pathParts);
        $filenameParts = explode('.', $filename);

        if (count($filenameParts) > 1) {
            return array_pop($filenameParts);
        }

        return '';
    }
public static function containsExtension ( string $ uri ) : string { $ pathParts = explode ( '/' , $ uri ) ; $ filename = array_pop ( $ pathParts ) ; $ filenameParts = explode ( '.' , $ filename ) ; if ( count ( $ filenameParts ) > 1 ) { return array_pop ( $ filenameParts ) ; } return '' ; }
Check whether a given URI contains an extension and return it.

@param string $uri URI to check.
@return string Extension that was found, empty string if none found.
Check whether a given URI contains an extension and return it .