There are checkboxes as follows:
Example 1, get the value of the check box.
-
- $loves=$_post['loves']; //Get the array;
- $loves=implode(",", $loves); //Convert the array into a string;
Copy code
Example 2, get the value of the check box.
-
- if(!empty($_post['loves'])){ //!empty($_post['loves'])
- $loves=$_post['loves'];
- echo(' Your selection result is:');
- for($i=0; $i
- echo($_post['loves'][$i]. ' ');
- }
- print_r($loves);
- $pid = implode(",",$loves);
- }
Copy code
|