# \[php\]loop-de-loop

**URL:** <https://forum.kirupa.com/t/php-loop-de-loop/139126>\
**Category:** Uncategorized\
**Created:** [February 28, 2005, 8:11pm UTC](https://forum.kirupa.com/t/php-loop-de-loop/139126 "2005-02-28T20:11:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cki](https://avatars.discourse-cdn.com/v4/letter/c/85f322/32.png) [@cki](https://forum.kirupa.com/u/cki)\
**Post date:** [February 28, 2005, 8:11pm UTC](https://forum.kirupa.com/t/php-loop-de-loop/139126/1 "2005-02-28T20:11:38Z")

</div>

Hello,

The following code snippet, traveses (2) arrays, checking for a match. I understand the first loop through ($usernames), but where is the interation called on ($passwords)?

```auto
 
// Now we loop through each entry in our arrays looking for a valid match
    for ($count = 0; $count < count($usernames) && $matchFound == false; $count++) {

        // If username and password matches entry...
        if ($username == $usernames[$count] && $password == $passwords[$count]) {

            // Get the user's message and indicate we've found a match
            $message = $messages[$count];
            $matchFound = true;
        }
    }

```
