A single-choice Button, radio, usually appears in a group with the same name value and different value values. in a group of single-choice buttons, only one of them may be selected at a time.
Obtains the value of a single-choice button.
In
Note: the checked attribute is used to set the meaning of the selected form element by default. when the form page is initialized, the element with the checked attribute is selected.
(3) in
(2) in
Add a PHP tag at any location outside the form element, use $ _ POST [] global variable to obtain the value of the check order, and then output it using the echo statement. The code is shown as follows:
(3) enter the running address in the browser and press enter to obtain the running result as shown in:
The above is the details of php getting the single-choice button of form and the check box value. For more information, see other related articles in the first PHP community!