L
L
lexstile2020-04-20 00:16:43
PHP
lexstile, 2020-04-20 00:16:43

Is there a way to check if each element of an array is in a string without a loop?

There is an array of strings: A long string comes from the server: How to check if at least one element of the array is in a string?
$array = ['Привет', 'Здравствуйте', 'Хай'];
$str = 'Здравствуйте, как дела?';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Edward, 2020-04-20
@IS-Builder

lexstyle

Is there a way to check if each element of an array is in a string without a loop?
There is no such way, because any function for processing an array "under the hood" implements a loop.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question