<form name="myform" action="index2.php" method="post">
興趣愛好
<input type="checkbox" name="v[]" value="閱讀"/>閱讀
<input type="checkbox" name="v[]" value="籃球"/>籃球
<input type="checkbox" name="v[]" value="旅遊"/>旅遊
<input type="submit" value="提交" />
</form>
PHP頁面:
$result = "";
foreach( $_POST['v'] as $i)
{
echo '<br>';
$result .= $i;
}
echo $result;
注意:name="v[]";