PHP SOP2.html
<!DOCTYPE html>
<html>
<head>
<title>SOP 2 PHP</title>
</head>
<body>
<form method="post" action="vowel.php">
<h1>Program to count no of vowels</h1>
Enter The String
<input type="text" name="txt_string">
<br>
<input type="submit" name="submit" value="Count vowel">
</form>
</body>
</html>
INFORMATION :- SAVE AS HTML FILE.
VOWELS.php
<?php
if(isset($_POST['submit']))
{
$str=strtolower($_POST['txt_string']);
$vowel=array('a','e','i','o','u');
$len=strlen($str);
$num=0;
for($i=0;$<$len;$i++)
{
if(in_array($str[$i], $vowel))
{
$num++;
}
}
echo "<b>Number of Vowels in entered string is:".$num;
}
INFORMATION :- SAVE AS PHP FILE.
Tags :-
12th I.T SOP solution,
12th I.T SOP,
12th I.T chapter 3 SOP solution,
12th I.T PHP SOP 2,
12th I.T SOP 2 PHP,
12th I.T SOP 2
0 Comments