PHP Practical File
PHP Practical File
<?php
error_reporting(0);
$num = $_POST['num'];
if($num)
{
for ($i=1; $i<=10; $i++)
{
$mul = $num * $i;
echo "$num * $i = $mul<br>";
}
}
else
{
echo "Invalid Entry!";
}
?>
?>
7. Print Fibonacci series up to n numbers e.g. 0 1 1 2 3 5 8
13 21…..n
<?php
$num = 0;
$n1 = 0;
$n2 = 1;
echo "<h3>Fibonacci series for first 12 numbers: </h3>";
echo "\n";
echo $n1.' '.$n2.' ';
while ($num < 10 )
{
$n3 = $n2 + $n1;
echo $n3.' ';
$n1 = $n2;
$n2 = $n3;
$num = $num + 1;
}
?>
// Output
echo "The Total marks = " . $total . "/500\n";
echo "<br>";
echo "The Average marks = " . $average . "\n";
echo "<br>";
echo "The Percentage = " . $percentage . "%";
echo "<br>";
?>
$fruits=array("lemon","orange","banana","apple");
sort($fruits);
foreach($fruits as $key=>$val){
echo $val."<br/>";
}
$str = "#BCA123Jyoti@XYZ*YADAV";
Countt($str);
?>