public static function get_icons_from_path($path) {
        $icons = array();
        if ($handle = @opendir($path)) {
            while (($file = readdir($handle)) !== false) {
                $matches = array();
                if (preg_match('~(.+?)(?:-24|-32|-48|-64|-72|-80|-96|-128|-256)?\.(?:svg|gif|png)$~',
                        $file, $matches)) {
                    $key = $matches[1];
                    $icons[$key] = $key;
                }
            }
            closedir($handle);
        }
        ksort($icons);
        return $icons;
    }
public static function get_icons_from_path($path) {
        $icons = array();
        if ($handle = @opendir($path)) {
            while (($file = readdir($handle)) !== false) {
                $matches = array();
                if (preg_match('~(.+?)(?:-24|-32|-48|-64|-72|-80|-96|-128|-256)?\.(?:svg|gif|png)$~',
                        $file, $matches)) {
                    $key = $matches[1];
                    $icons[$key] = $key;
                }
            }
            closedir($handle);
        }
        ksort($icons);
        return $icons;
    }
public static function get_icons_from_path ( $ path ) { $ icons = array ( ) ; if ( $ handle = @ opendir ( $ path ) ) { while ( ( $ file = readdir ( $ handle ) ) !== false ) { $ matches = array ( ) ; if ( preg_match ( '~(.+?)(?:-24|-32|-48|-64|-72|-80|-96|-128|-256)?\.(?:svg|gif|png)$~' , $ file , $ matches ) ) { $ key = $ matches [ 1 ] ; $ icons [ $ key ] = $ key ; } } closedir ( $ handle ) ; } ksort ( $ icons ) ; return $ icons ; }
Gets all unique file type icons from a specific path, not including
sub-directories.

Icon files such as pdf.png, pdf-24.png and pdf-36.png etc. are counted as
the same icon type.

The resultant array has both key and value set to the icon name prefix,
such as 'pdf' => 'pdf'.

@param string $path The path of the icon path
@return array An array of unique file icons within the given path
Gets all unique file type icons from a specific path not including sub - directories .