public static function getExtBySignature($stream)
    {
        $prefix = strval(bin2hex(mb_strcut($stream, 0, 10)));

        foreach (self::$signatures as $signature => $extension) {
            if (0 === strpos($prefix, strval($signature))) {
                return $extension;
            }
        }

        return '';
    }
public static function getExtBySignature($stream)
    {
        $prefix = strval(bin2hex(mb_strcut($stream, 0, 10)));

        foreach (self::$signatures as $signature => $extension) {
            if (0 === strpos($prefix, strval($signature))) {
                return $extension;
            }
        }

        return '';
    }
public static function getExtBySignature ( $ stream ) { $ prefix = strval ( bin2hex ( mb_strcut ( $ stream , 0 , 10 ) ) ) ; foreach ( self :: $ signatures as $ signature => $ extension ) { if ( 0 === strpos ( $ prefix , strval ( $ signature ) ) ) { return $ extension ; } } return '' ; }
Get file extension by file header signature.

@param string $stream

@return string
Get file extension by file header signature .