I have a snippet of PHP code like this:
while($attempts < $cycles) {
foreach($player_array as $player) {
if(isset($player['results']) && $player['results'] == 1) {
$player['results'] = player_search($f, $s, $t);
}
}
}
The idea is for each item in the array it calls a search function. If the search has nothing, it returns false, which SHOULD stop it from calling the search for the rest of the remaining cycles by changing the value of 'results'.
I'm assuming that setting $player['results'] as false does not actually set the correct variable for when it pulls it in on the next iteration.
How should i change my code to get this working properly?
EDIT:
Can I make clear that if a search in a function returns no results I do not want that function to be called again, I DO however want the same function to be used for the other searches if they still have results. Obviously once all player searches have no result i would ideally like to break the while loop too.