Quantcast
Channel: User Mohamed Mufeed - Stack Overflow
Viewing all articles
Browse latest Browse all 37

Answer by Mohamed Mufeed for Return Value inside if statement inside for loop inside function

$
0
0

You can actually do something like this

function checkGroup($groupNum, $names, $namesNow, $group, $groupSize, $i){    $ret = true;    for ($m=0; $m < count($group); ++$m /* or $m++? */){        //checks to make sure current person doesn't conflict with anyone else in current group        if (!($namesNow[$names[$i]][$group[$m]] < $max)){            $ret = false;            break;        }    }    return $ret;}

Viewing all articles
Browse latest Browse all 37

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>