嗨,我查看了其他答案,他们说要添加 name=checkbox[] 以使数组返回,但它似乎不起作用。
HTML 是:
<select class="select" multiple="multiple" name="suburb[]" id="suburb">
<option selected="selected" name="suburb[]" value="Southbank">Southbank</option>
<option selected="selected" name="suburb[]" value="Melbourne">Melbourne</option>
<option selected="selected" name="suburb[]" value="Docklands">Docklands</option>
<option selected="selected" name="suburb[]" value="South Melbourne">South Melbourne</option>
<option selected="selected" name="suburb[]" value="West Melbourne">West Melbourne</option>
<option selected="selected" name="suburb[]" value="Point Cook">Point Cook</option>
<option selected="selected" name="suburb[]" value="Sanctuary Lakes">Sanctuary Lakes</option>
<option selected="selected" name="suburb[]" value="Truganina">Truganina</option>
<option selected="selected" name="suburb[]" value="Williams Landing">Williams Landing</option>
PHP代码是:
$message .= "<tr><td><strong>Interested Suburbs:</strong> </td><td>" . strip_tags($POST_['suburb']) . "</td></tr>";