PHP Nested Loop - Comparing each item in two arrays and outputting them as checked or unchecked textboxes
<p>I think the title explains most of it. The items of the two arrays that I know are matching strings do not come out as checked checkboxes. What I have:</p>

<p>*Edit: realized I was using the wrong array. However, now I'm only getting the first entry right because of th breaks. </p>

<pre><code>&lt;?php
        foreach ($list as $x){
            foreach ($arr as $y){
                if ($x == $y){
                    echo '&lt;li&gt;';
                    echo '&lt;input type="checkbox" checked="checked" value="'.$x.'" /&gt;'.$x.'&lt;br/&gt;';
                    echo '&lt;/li&gt;';
                        break;
                }
                else {
                    echo '&lt;li&gt;';
                    echo '&lt;input type="checkbox" value="'.$x.'" /&gt;'.$x.'&lt;br/&gt;';
                    echo '&lt;/li&gt;';
                        break;
                }
            }
        }
        echo '&lt;/ul&gt;';
?&gt;
</code></pre>
