What are the differences between radio buttons and checkboxes in PHP forms?

Radio buttons allow users to select only one option from a group of options, while checkboxes allow users to select multiple options. In PHP forms, radio buttons are typically used when users need to make a single selection, such as choosing a gender or a payment method. On the other hand, checkboxes are used when users can select multiple options, such as selecting multiple interests or preferences.

<form action="process_form.php" method="post">
  <input type="radio" name="gender" value="male"> Male<br>
  <input type="radio" name="gender" value="female"> Female<br>

  <input type="checkbox" name="interests[]" value="music"> Music<br>
  <input type="checkbox" name="interests[]" value="sports"> Sports<br>
  <input type="checkbox" name="interests[]" value="movies"> Movies<br>

  <input type="submit" value="Submit">
</form>