Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Issue with Generating Random Numbers using Laravel contains vs foreach loop

public function checkIfUserHasDraw($number)
{
    foreach ($this->subscribers as $user) {
        if ($user->drawOrder == $number) {
            return true;
        }
    }
    return false;
}
 
PREVIOUS NEXT
Tagged: #Issue #Generating #Random #Numbers #Laravel #foreach #loop
ADD COMMENT
Topic
Name
2+4 =