N
N
nevesomostjke2021-09-21 15:44:17
PHP
nevesomostjke, 2021-09-21 15:44:17

How to compare values ​​for similarity in arrays in PHP?

Hello. For example. There are 2 arrays (or there may be more).
Each of them has meanings (conventional names for something). For example:

Array 1
[0]
Name: Vladimir
[1]
Name: Alex

Array 2
[0]
Name: Maxim
[1]
Name: Alex

OBJECTIVE:
Calculate similar values ​​in arrays. Using for example the similar_text function. And so that it would be possible to work with array values ​​1, 2. I.e. I need to further create one array, for example:
Array Alex
Here I can insert any values ​​from array 1
And here I can insert values ​​from array 2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-09-21
@nevesomostjke

There are quite a few metrics for word similarity. Choose whichever suits you and implement.
https://en.wikipedia.org/wiki/String_metric

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question