IT PHP Practical With OUTPUT
IT PHP Practical With OUTPUT
<html>
<head>
<title>Eligibility to Vote</title>
</head>
<body>
<form method="POST">
</form>
<?php if(isset($_POST['submit'])){
else
?>
</body>
</html>
SOP 2. Write a PHP function to count the total number of vowels ( a, e, I, o, u) from the string. Accept a string by
using HTML form.
<html>
<body>
</form>
</body>
</html>
<?php if($_POST)
$string = strtolower($_POST['string']);
$vowels = array('a','e','i','o','u');
$len = strlen($string);
$num = 0;
$num++;
?>
SOP 3. Write a PHP program to perform the following operation on an associative array.
<?php
$ml=array("English"=>"55","Hindi"=>"60","Maths"=>"70","Marathi"=>"85");
echo "<br><br><b>Elements of an array along with their keys:</b>";
echo "<br> <br> Your score ".$ml['English']." in English";
echo "<br> <br> Your score ".$ml['Hindi']." in Hindi";
echo "<br> <br> Your score ".$ml['Maths']." in Maths";
echo "<br> <br> Your score ".$ml['Marathi']." in Marathi";
echo "<br><br><b>Size of an array is :</b>".count($ml);array_splice($ml,0,1);
echo "<br><br><b>
After deleting array is :</b>";
foreach($ml as $x => $x_value)
{echo "<br><br>Key=". $x. ", Value=" . $x_value;
echo "<br>";
}
?>