Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $hasil=array();
- //$jawaban=$_POST['jawaban'];
- $jawaban=array('A','B','A','B','C','D','A','D','C','B','C','D','A');
- for($i=0;$i<count($jawaban);$i++){
- $ada=0;
- for($j=0;$j<count($hasil);$j++){
- if($jawaban[$i]==$hasil[$j][1]){
- $hasil[$j][0]++;
- $ada=1;
- }
- }
- if($ada==0){
- $hasil[]=array(1,$jawaban[$i]);
- }
- }
- for($i=0;$i<count($hasil);$i++){
- echo "jawaban ".$hasil[$i][1]."=".$hasil[$i][0]."<br/>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement