Which method is faster?
<p>I have a text file that serves as a simple database, each entry spanning two lines, like so:</p>

<pre><code>name
number
bob
39
jack
22
jill
85
</code></pre>

<p>Now say that I have each line separated in an array, and I wanted to analyze each NAME and see if it equals a variable. Would it be faster to do this:</p>

<pre><code>if($variable == $line) {
    //true
}
</code></pre>

<p>Or first filter out the even numbered lines (the names), and then analyze them to see if they equal the variable? If you don't know, the first line following basically finds the remainder of the count (this is all in a foreach loop) divided by 2, and if it equals 0 then it is an even number.</p>

<pre><code>if ($count%2 == 0) {
    if($variable == $line) {
        //true
    }
}
</code></pre>

<p>Thanks.</p>
