Sunday 22 March 2015

PHP program to find if a character is vowel or a consonant

PHP program to find if a character is vowel or a consonant

<?php
    $char=$_POST['ch'];
    if($char=="a")
     {
       echo $char."&nbsp&nbsp is vowel";  
     }
    elseif($char=="e")
    {
       echo $char."&nbsp&nbsp is vowel";
    }
    elseif($char=="i")
    {
       echo $char."&nbsp&nbsp is vowel";
    }
    elseif($char=="o")
    {
       echo $char."&nbsp&nbsp is vowel";
    }
    elseif($char=="u")
    {
       echo $char."&nbsp&nbsp is vowel";
    }
    else
    {
        echo $char. "&nbsp&nbspis consonant";
    }
 ?>
  
 <body>
    <form method="post">
       Enter a character<input type="text" name="ch"/><hr/>
        <input type="submit"/>
    </form>
 </body>

No comments:

Post a Comment