PHP 1 - 6 Programs
PHP 1 - 6 Programs
PHP 1 - 6 Programs
<HTML>
<HEAD><TITLE> PHP program on Table </TITLE></HEAD>
<BODY>
<?PHP
$t = 7;
$i = 1;
print "Print the table of given No. $t <BR><BR>";
for ($i; $i <= 10; $i++)
{
print "$t * $i = ".($t * $i). "<BR>";
}
?>
</BODY>
</HTML>
<HTML>
<HEAD><TITLE>To find factorial of a given no. using while loop
</TITLE></HEAD>
<BODY>
<?php
$num1 = 5;
$fact = 1;
$counter = 1;
Filename.php – rspstring.php
b)
<?php
$s1 = $_POST["string"];
$s2 = strlen($s1);
$s3 = strrev($s1);
echo "The given string is : $s1 <br><br>";
echo "The length of the string is : $s2<br><br>";
echo "The reverse string is : $s3<br><br>";
?>
<?php
$word=$_GET[‘string’];
$x=strrev($word);
if ($x==$word)
{
echo “The given word $word is palindrome”;
}
else
{
echo “The given word $word is NOT palindrome”;
}
5. To find greatest of three given nos. rsgreat.php
<HTML>
<HEAD><TITLE>To find greatest of three given nos. </TITLE></HEAD>
<BODY>
<?PHP
<?php