Answer the question
In order to leave comments, you need to log in
How to check if a variable contains any value from an array?
I have the following array with values.
$arr = array('141241241', '5463263', '124124124', '4254512');
$id
if
$id
contains at least one value from the array, then outputecho "Найден id - ".$id."<br>";
Answer the question
In order to leave comments, you need to log in
$arr = array('141241241', '5463263', '124124124', '4254512');
if (in_array("$id", $arr)) {
echo "Найден ID - ".$id."<br>";
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question