Send radio box value with $_POST
问题 How can I send a radio or checkbox value to the $_POST array even when the field is empty? <?php if(isset($_POST)) { echo '<pre>'; print_r($_POST); echo '</pre>'; } ?> <form action="test.php" method="POST"> <input type="text" name="name"> <input type="text" name="email"> <input type="radio" name="gender"> <input type="submit"> </form> Here is what I get from the page if I hit submit without even filling out data. Array ( [name] => [email] => ) As you see, without touching the input type text,