<?php $_POST = ['checkbox_1' => 1, 'checkbox_4' => 8, 'checkbox_8' => 1]; $result = ''; for($i = 1; $i <= 10; $i++) { if(isset($_POST['checkbox_' . $i])) $result .= ' ' . $i; } echo trim($result);
You have javascript disabled. You will not be able to edit any code.