Professional Documents
Culture Documents
Online Shopping Project
Online Shopping Project
Online Shopping Project
$sum=0;
if($i%2==0)
$sum=$sum+$i;
?>
PROGRAM 02: WAP to display pattern using nested for loop
<?php
for($i=1;$i<=5;$i++)
for($j=1;$j<=$i;$j++)
echo "*";
echo "<br>";
?>
PROGRAM 03: WAP using the string ‘mary had a little lamb’ display string
function
<?php
?>
PROGRAM 04: WAP to count and display numbers of a and l in “mary had a
little lamb”.
<?php
$acount=0;
$lcount=0;
for($i=0;$i<=strlen($a);$i++)
if(substr($a,$i,1)=='a')
$acount=$acount+1;
if(substr($a,$i,1)=='l')
$lcount=$lcount+1;
echo "<br>";
?>
PROGRAM 05: WAP to display the table with 10 rows and 10 columns showing
all possible 2 digit combinations.