Compute 1st value on multiple values on a checkbox
<p>I was trying to make a COMPUTERIZED ORDERING SYSTEM. My problem is how can I compute the 1st value on my checkbox. The second value on the checkbox will be posted on the summary of orders.</p>

<p>Once I've check all those three, it will compute the total amount of the menu and to display the selected menu on the summary of orders. But I can't figure out how can I display the total amount.</p>

<p>Can anybody guide me how to compute the total on my 1st value on the checkbox?</p>

<pre><code>&lt;form method="post"&gt;
    &lt;input name='ts[]' type='checkbox' value='40 |Tosilog'/&gt; Tosilog
    &lt;br&gt;
    &lt;input name='cs[]' type='checkbox' value='40 |Chiksilog'/&gt;Chiksilog
    &lt;br&gt;
    &lt;input name='ps[]' type='checkbox' value='45 |Porksilog'/&gt;Porksilog
    &lt;br&gt;
    &lt;input type="submit" name="go" value= "Total"&gt;
&lt;/form&gt;


&lt;?php 
//tosilog
    $ts = $_POST['ts'];
    $value = explode("|",$ts[0]);
    echo $value[0];
    echo $value[1];


//chiksilog
    $cs = $_POST['cs'];
    $value = explode("|",$cs[0]);
    echo $value[0];
    echo $value[1];


//porksilog
    $ps = $_POST['ps'];
    $value = explode("|",$ps[0]);
    echo $value[0];
    echo $value[1];

?&gt;
    &lt;!-- compute for the 1st value on checkbox --&gt;  
 &lt;?php

            $ts=$_POST['ts[0]'];
            $cs=$_POST['cs[0]'];
            $ps=$_POST['ps[0]'];

?&gt;


    &lt;?php $compute = $ts[0] + $cs[0] + $ps[0];?&gt;

    &lt;?php echo "$compute " ; ?&gt;
</code></pre>
