Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_POST) {
- $chk1 = $_POST['chkabc1'];
- $chk2 = $_POST['chkabc2'];
- $chk3 = $_POST['chkabc3'];
- for ($i = 0; $i < count($chk1); $i++) {
- echo "Checkbox 1 value ".$chk1[$i]."<br>";
- echo "Checkbox 2 value ".$chk2[$i]."<br>";
- echo "Checkbox 3 value ".$chk3[$i]."<br>";
- }
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title></title>
- <link rel="stylesheet" href="">
- </head>
- <body>
- <form action="http://localhost/coba/arraykosong.php" method="POST" >
- <input type="checkbox" name="chkabc1[]" value="11">
- <input type="checkbox" name="chkabc1[]" value="12">
- <input type="checkbox" name="chkabc1[]" value="13">
- <input type="checkbox" name="chkabc1[]" value="14">
- <br>
- <input type="checkbox" name="chkabc2[]" value="21">
- <input type="checkbox" name="chkabc2[]" value="22">
- <input type="checkbox" name="chkabc2[]" value="23">
- <input type="checkbox" name="chkabc2[]" value="24">
- <br>
- <input type="checkbox" name="chkabc3[]" value="31">
- <input type="checkbox" name="chkabc3[]" value="32">
- <input type="checkbox" name="chkabc3[]" value="33">
- <input type="checkbox" name="chkabc3[]" value="34">
- <br>
- <button type="submit">submit</button>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement