Advertisement
cdsatrian

checkbox 20170119001

Jan 19th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. //--- form inputan
  2. <?php
  3. $hobi=array('olahraga'=>'Olahraga','bacabuku'=>'Baca Buku','internetan'=>'Internatan');
  4. $i=0;
  5. foreach($hobi as $val=>$text)
  6. echo "<tr><td>".($i++==0?'Hobi':'')."</td><td><input type='checkbox' name='hobi[]' value='{$val}'>{$text}</td></tr>";
  7. ?>
  8.  
  9.  
  10. //-- proses, hasil yang diterima
  11. $hobi=implode(" ",$_POST['hobi']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement