S
S
Sergey Brovko2020-05-28 02:22:34
PHP
Sergey Brovko, 2020-05-28 02:22:34

How to implement comparison results in code?

Hello. It seems that I did a simple task for myself, but I can’t figure out how to implement it in the form of code.

The bottom line is that there is a certain set of patterns, patterns by which we are looking for files, something may be in the pattern, but something is not. Depending on which pattern was found (or several of them), then indicate the most probable variant.

Example:
The list of patterns is given as
pattern1,image
pattern2,image
pattern3, image
pattern4, music
pattern5, music pattern6
, music
pattern7, text
pattern8, text
pattern9, text

.
The file types are just examples. There are patterns themselves, there is a search, but here's how to make the most likely option - I'm dumbing something down

Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2020-05-28
@Rsa97

There is a file utility, it determines the file type and some of its parameters. You can see the implementation and signature sets in the sources ( ftp://ftp.astron.com/pub/file/ ).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question