Send radio box value with $_POST

前端 未结 6 1729
鱼传尺愫
鱼传尺愫 2021-01-19 11:10

How can I send a radio or checkbox value to the $_POST array even when the field is empty?

\';
            


        
6条回答
  •  一整个雨季
    2021-01-19 12:07

    Consider this example:

    // Set a default value as male
     Male
     Female
    

    and you will get the value

    Array
    (
        [name] => 
        [email] => 
        [gender]=>male
    )
    

    You only get the checked radio in the $_POST array

提交回复
热议问题