Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>NisrinaNadaAgnela XIRPL1</title>
- </head>
- <body>
- <center>
- <h1>Menghitung Jumlah Huruf Vokal</h1>
- <form method="post">
- <p>Masukan Nama Anda (dalam huruf kecil) <input type="text" name="Nama"></p>
- <input type="radio" name="alp" value="a">a
- <input type="radio" name="alp" value="i">i
- <input type="radio" name="alp" value="u">u
- <input type="radio" name="alp" value="e">e
- <input type="radio" name="alp" value="o">o
- <input type="submit" name="submit" >
- <br/>
- <br/>
- <?php
- if (isset($_POST['submit'])) {
- $nama=$_POST['Nama'];
- $alpabet = $_POST['alp'];
- $hitung = 0;
- $j = 0;
- while ($j < strlen($nama)){
- if ($nama[$j] == $alpabet ) {
- $hitung++;
- }
- $j++;
- }
- echo "Jumlah huruf ".$alpabet." pada nama ".$nama." adalah ". $hitung;
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement