Checkbox For each loop
<p>Can you please look at the code? Where I am wrong?</p>

<p>I have different checkboxes with values as under, what I am trying to do is add the total from previous post name $total+separate interger from the strings,i need the value in checkbox with same as i did so dont worry why i do this.Whatever the user checked the checkboxes values will be added to  $total variable. Foreach loop does not do what I want, I know it iterates the loop and add it. Any alternative solution?</p>

<pre><code>  $total=$_POST['total-price']; //prevoius page post
    foreach($_POST["features"] as $checkedValue) {
       echo $checkedValue . "&lt;br /&gt;";
       $int = filter_var($checkedValue, FILTER_SANITIZE_NUMBER_INT); //seperate integer from string
       $sum= $int + $total;
       echo "final total:\$" .$sum . "&lt;br /&gt;";
    }
</code></pre>

<p>HTML checkboxes:</p>

<pre><code>&lt;input id="2" type="checkbox"  onClick="" name="features[]" value="Mobile Development $100"/&gt;
&lt;input id="2" type="checkbox"  onClick="" name="features[]" value="Mobile Development $100"/&gt;
</code></pre>
