The PHP tutorial must be in the form of an array when obtaining the checkbox multi-option value. The following is test[] and then use PHP post to obtain it. See the code below.
Pay attention to the name attribute of the input above. The content of each attribute is the same, and they are all test[]. The reason for adding [] is to transfer the content of test into an array.
The code content of checktest.php is as follows:
$str =implode(',',$_post['test']);
print_r($str);
12345
Oh. Below is what a friend of mine wrote.
php code
The square brackets after weeks cannot be missed, otherwise only the last value can be obtained when using PHP. After that, php will be easy to handle, as follows:
php code
Method 1:
$weeks = $_post['weeks'];
for($i=0;$iecho $weeks[1]."
";
Method 2:
$array = $this->request->getparameter("weeks[]");
$str =implode(',',$array);
echo $str;