src/Utilities/Miscellaneous.php
public static function getFileNameFromPath($path)
    {
        $matches = [];
        $pattern = sprintf('|([^\%s.]+\.[A-Za-z0-9.]+)$|', DIRECTORY_SEPARATOR);

        if ((bool)preg_match($pattern, $path, $matches)) {
            return $matches[1];
        }

        return '';
    }
public static function getFileNameFromPath($path)
    {
        $matches = [];
        $pattern = sprintf('|([^\%s.]+\.[A-Za-z0-9.]+)$|', DIRECTORY_SEPARATOR);

        if ((bool)preg_match($pattern, $path, $matches)) {
            return $matches[1];
        }

        return '';
    }
public static function getFileNameFromPath ( $ path ) { $ matches = [ ] ; $ pattern = sprintf ( '|([^\%s.]+\.[A-Za-z0-9.]+)$|' , DIRECTORY_SEPARATOR ) ; if ( ( bool ) preg_match ( $ pattern , $ path , $ matches ) ) { return $ matches [ 1 ] ; } return '' ; }
Returns file name from given path

@param string $path A path that contains file name
@return string
Returns file name from given path