I have this array of random numbers created by a table in database
$numbersArr = array(3,5,17,19,24,30,38,...)
$userInput = 35;
So far this is what I have
if (in_array($userInput, $numbersArr)){
echo 'found needle';
}else{
//add one to the $userInput until find a needle
}
So the program would add 1 to 35 until it found 38, then stop. How can I do this? I'm pretty sure it's straightforward but I cant wrap my head around it.