PHP: Determine whether its a checkbox is checked or not
<p>My checkbox looks like this:</p>

<pre><code>&lt;input type="checkbox" name="activate[]" class="setSetting" value="&lt;?php echo $row["id"]; ?&gt;"&gt;
</code></pre>

<p>And then i have a foreach:</p>

<pre><code>$activate = $_POST['activate']; 
        foreach($activate as $a){
        echo $a ."&lt;br&gt;";
        }
</code></pre>

<p>Works fine to get the value out of. But how can i determine if the checkbox has been checked?</p>

<pre><code>$activate = $_POST['activate']; 
        foreach($activate as $a){
        $query_email = mysql_query("SELECT id FROM lp_email_settings ORDER BY id ASC");
            while($ro = mysql_fetch_row($query_email)){
            $getUserSettings = mysql_query("SELECT * FROM users_email_settings WHERE uID = '$USER' AND eSetting = '$ro[0]'");
                if($ro[0] == $a){
                    if(mysql_num_rows($getUserSettings) != 1){
                    mysql_query("INSERT INTO users_email_settings (uID, eSetting) VALUES ($USER, $ro[0])");
                    }
                }else{
                mysql_query("DELETE FROM users_email_settings WHERE uID = '$USER' AND eSetting = '$ro[0]'");
                }
            }
            echo $a."&lt;br&gt;";
        }
</code></pre>
