I want to know if there is a way to compare by means of some PHP method, and verify that two chains regardless of the order are the same,
for example:
$string1 = "Pedro Perez";
$string2 = "Perez Pedro";
So my question is how can I make this TRUE
in a comparison. Clearly, your order makes it different.
I ask this question because I am developing a search, and I want a comparison of $string1
and $string2
to be taken as the same value, regardless of the order they have, as long as the string has the same words