从foreach循环创建字符串

I have an checkbox form where users can select multiple boxes. now i want to get the value of each checked checkbox into one string.

this is what i have now!

            <input onClick="return KeepCount()" type="checkbox" name="keus[]" value="A"> Test 
            <input onClick="return KeepCount()" type="checkbox" name="keus[]" value="B"> Test 
            <input onClick="return KeepCount()" type="checkbox" name="keus[]" value="C"> Test
            <input onClick="return KeepCount()" type="checkbox" name="keus[]" value="D"> Test


    $keuzen = $_POST['keus'];

        foreach($keuzen as $keus) {
          $finalOptions = $keus;
        }

    echo $finalOptions;

the $finalOptions returns only the last checked box value...

when I select A & D $finalOptions says only D if i select C & A $finalOptions says only C etc...

someone who can help me please??

without looping it

<?php 
    $keuzen = $_POST['keus'];
    echo implode(',',$keuzen);

Try this:

<?php 
 $keuzen = $_POST['keus'];
 $finalOptions ="";

 foreach($keuzen as $keus) {
   $finalOptions .= $keus.","; // you may wanted to separate it with some delimiter
 }

 echo $finalOptions;
?>