How to make sure the value is reset in foreach loop in PHP
<p>I was writing a simple PHP page and a few foreach loops were used.</p>

<p>Here are the scripts:</p>

<pre><code>$arrs = array("a", "b", "c");

foreach ($arrs as $arr) {
    if(substr($arr,0,1)=="b") {
        echo "This is b";
    }     
} // end of first foreach loop and I didn't use ifelse here
</code></pre>

<p>And when this foreach ends,
I wrote another foreach loop in which all the values in the foreach loop
was the same as previous foreach.</p>

<pre><code>foreach ($arrs as $arr) {
    if(substr($arr,0,1)=="c") {
        echo "This is c";
    }     
}
</code></pre>

<p>I am not sure if it is a good practice to have two foreach loops with same values and keys.</p>

<p>Will the values get overwritten in the first foreach loop?</p>
