title: Two values from an array checkbox
body: <p>So I have a mysql table for the charges of a hospital. My program currently only gets the price of the checked procedure. But now, I also want to get the procedure name when it is checked. </p>
  
  <p>transaction.php</p>
  
  <pre><code>while($row = mysql_fetch_array($result))
  {
       echo ' &lt;tr&gt; &lt;td&gt;'.$row[0].'&lt;/td&gt; &lt;td&gt;'.$row[1].'&lt;/td&gt;&lt;td&gt;'.$row[2].'&lt;/td&gt;';
       $procedure=$row['procedure'];
       echo '&lt;td&gt;&lt;input type="checkbox" name="er[]" value="$price."|".$procedure"&gt;&lt;/td&gt;';
       echo "&lt;/tr&gt;";
  }
  echo '&lt;/table&gt;';
  </code></pre>
  
  <p>computation.php</p>
  
  <pre><code>  &lt;?php
        if(isset($_POST['er']))
        {
          $ercharge=$_POST['er'];
          $totalofer = array_sum($ercharge);  
        }
        if(isset($_POST['ultrasound']))
        {
          $x=$_POST['ultrasound'];
          $totalofultrasound =  array_sum($x);
        }
        if(isset($_POST['confinement']))
        {
          $y=$_POST['confinement'];
          $totalofconfinement =  array_sum($y);
        }
        $total = $totalofer + $totalofultrasound + $totalofconfinement;
        $p = explode("|", $ercharge);
        echo $p;
        echo  $total;
  ?&gt;
  </code></pre>
  
  <p>It only gets the row for price. Can the value attribute have two values? I can't just make another checkbox cause that would be inappropriate. </p>
  
  <p>edit: the explode function doesnt work. It says: Warning: explode() expects parameter 2 to be string, array given in C:\xampp\htdocs\computation.php on line 18</p>