Monday, 14 July 2014

PHP6 and Unicode

PHP received mixed reviews due to lacking native Unicode support at the core language level.In 2005, a project headed by Andrei Zmievski was initiated to bring native Unicode support throughout PHP, by embedding the International Components for Unicode (ICU) library, and representing text strings as UTF-16 internally.[33] Since this would cause major changes both to the internals of the language and to user code, it was planned to release this as version 6.0 of the language, along with other major features then in development.

However, a shortage of developers who understood the necessary changes, and performance problems arising from conversion to and from UTF-16, which is rarely used in a web context, led to delays in the project. As a result, a PHP 5.3 release was created in 2009, with many non-Unicode features back-ported from PHP 6, notably namespaces. In March 2010, the project in its current form was officially abandoned, and a PHP 5.4 release was prepared containing most remaining non-Unicode features from PHP 6, such as traits and closure re-binding.Initial hopes were that a new plan would be formed for Unicode integration, but as of 2014 none has been adopted.

During the years before the release of PHP 5.3 and 5.4, some books were published based on the expected feature set of PHP 6.0, including both the Unicode work and the features which were later backported to other releases. There is therefore some debate over whether a new major version of PHP, with or without Unicode support, should be called "PHP 6", or if the version should be skipped to avoid confusion.

Wednesday, 12 February 2014

SUBMIT FORM USING PHP.

INPUT:
SUBMIT.html:
<html>
<body>
<form action="hai.php" method="post">
Enter the Name:
<input type="text" name="name1"/><br/>
Enter the College:
<input type="text" name="college"/><br/>
<input type="submit"/>
</form>
</body>
</html>
hai.php:
<html>
<body>
<h1>
<?php
echo $_POST["name1"]."<br>";
echo $_POST["college"];
?>
</h1>
</body>
</html>

Tuesday, 11 February 2014

DISPLAY NAME 10 TIMES & TOTAL AVERAGE OF 6 SEMESTER IN PHP

INPUT:
<html>
<head><h1>Display 10 times name and average marks</h1></head>
<body>
<H1>
<?php
$sanket_average;
$sanket_total;
$sanket_sem1=400;
$sanket_sem2=400;
$sanket_sem3=400;
$sanket_sem4=400;
$sanket_sem5=400;
$sanket_sem6=400;
$sanket;
for($sanket=1;$sanket<=10;$sanket++)
{
echo "AAA<br>";
}
$sanket_total=$sanket_sem1+$sanket_sem2+$sanket_sem3+$sanket_sem4+$sanket_sem5+$sanket_sem6;
$sanket_average=($sanket_total/3000)*100;
echo "Total average = ".$sanket_average;
?>
</h1>
</body>
</html>

CHECK WHETHER GIVEN NUMBER IS PRIME OR COMPOSITE IN PHP

INPUT:
<html>
<head><h1> Check whether the numbers are prime or not .</h1></head>
<body>
<H1>
<?php
$sanket_a=10;
$c;
$sanket;
$x;
for($x=2;$x<=$sanket_a-1;$x++)
{
$c=0;
for($sanket=2;$sanket<=($x/2);$sanket++)
{
if(($x%$sanket)==0)
$c++;
}
}
if($c==0)
{
echo $x." is a prime number<br>";
}
else
{
echo $x." is a composite number<br>";
}
?>
</h1>
</body>
</html>

CHECK GIVEN NUMBER IS PALINDROME OR NOT IN PHP

INPUT:

<html>
<head><h1>Check whether given number is palindrome or not</h1></head>
<body>
<H1>
<?php
$sanket_n=12345;
$sanket_dn=$sanket_n;
$sanket_t=0;
$sanket_d;
while($sanket_dn!=0)
{
$sanket_d=$sanket_dn%10;
$sanket_t=($sanket_t*10)+$sanket_d;
$sanket_dn=($sanket_dn/10);
}
if($sanket_n==$sanket_t)
{
echo " The number ".$sanket_n." is a palindrome";
}
else
{
echo " The number ".$sanket_n." is not a palindrome";
}
?>
</h1>
</body>
</html>

ARRAY USING FOREACH STATEMENT IN PHP


INPUT:
<html>
<head><h1>Array using foreach statement</h1></head>
<body>
<H1>
<?php
$sanket_a=array(1,2,3,4);
foreach($sanket_a as $sanket_i)
echo $sanket_i;
?>
</h1>
</body>


</html>

DETERMINE WHETHER THE NUMBER IS EVEN OR ODD IN PHP

INPUT:
<html>
<head><h1>Check whether even or odd</h1></head>
<body>
<H1>
<?php
$sanket_a=10;
if($sanket_a%2==0)
echo $sanket_a." is an Even number";
else
echo $sanket_a." is an Odd number";
?>
</h1>
</body>
</html>

CALCULATE SIMPLE INTEREST IN PHP


INPUT:
<html>
<head><h1>Display Profile</h1></head>
<body>
<H1>
<?php
$sanket_p=10;
$sanket_n=10;
$sanket_r=1;
$sanket_pi=($sanket_p*$sanket_n*$sanket_r)/100;
echo " Simple Interest =".$sanket_pi;
?>
</h1>
</body>
</html>

DISPLAY RESULT IN PHP.


INPUT:
<html>
<head><h1>Display Result</h1></head>
<body>
<H1>
<?php
$sanket_pcs=90;
$sanket_maths1=90;
$sanket_etc=90;
$sanket_fdc=90;
$sanket_cpp=90;
$sanket_maths2=90;
$sanket_wdp=90;
$sanket_dcn=90;
$sanket_dbms=90;
$sanket_mmc=90;
$sanket_sem1=$sanket_pcs+$sanket_maths1+$sanket_etc+$sanket_fdc+$sanket_cpp;
$sanket_sem2=$sanket_maths2+$sanket_wdp+$sanket_dcn+$sanket_dbms+$sanket_mmc;
$sanket_total=$sanket_sem1+$sanket_sem2;
$sanket_average=$sanket_total/10;
echo "<br>Semester 1 =".$sanket_sem1;
echo "<br>Semester 2 =".$sanket_sem2;
echo "<br>First Year Total Marks =".$sanket_total;
echo "<br>Average =".$sanket_average;
?>
</h1>
</body>


</html>

DISPLAY PROFILE IN PHP

INPUT:
<html>
<head><h1>Display Profile</h1></head>
<body>
<H1>
<?php
$sanket1="AAA";
$sanket2="F.Y.I.T";
$sanket3="2120xx";
$sanket4="WCCBM";
echo "Name =".$sanket1."<br>Course =".$sanket2."<br>Rollno =".$sanket3."<br>College =".$sanket4;
?>
</h1>
</body>


</html>

IMPLEMENTING MATH FUNCTION IN PHP

INPUT:
<html>
<body>
<b>
<?php
echo "Cosine value of 90 = ".cos(90);
echo "<br>Max of 10,20 = ".max(10,20);
echo "<br>Power of 2 raise to 5 = ".pow(2,5);
echo "<br>Exponential value of 90 = ".exp(90);
echo "<br>Log of 1 = ".log(1);
echo "<br>Minimum of 54,65,24 = ".min(54,65,24);
echo "<br>Rounded value of 25.645 = ".round(25.645);
echo "<br>Tan value of 45 = ".tan(45);
echo "<br>Square root of 64 = ".sqrt(64);
echo "<br>floor of 53.2 = ".floor(53.2);
echo "<br>ceil of 53.2 = ".ceil(53.2);
echo "<br>Random no = ".rand();
?>
</b>
</body>
</html>

PROGRAM TO DISPLAY DATE IN PHP

INPUT:
<html>
<body>
<b>
HH-MM-SS =
<?php
echo date("h:i:s")."<br>";
?>
</b>
</body>
</html>

ARRAY IN PHP

INPUT:
<html>
<body>
<STRONG>
<?php
$sanket[0]="aaa";
$sanket[1]="bbb";
$sanket[2]="ccc";
$sanket[3]="ddd";
$sanket[4]="eee";
$sanket[5]="fff";
$sanket[6]="ggg";
echo $sanket[0]."<br>".$sanket[1]."<br>".$sanket[2]."<br>".$sanket[3]."<br>".$sanket[4]."<br>".$sanket[5]."<br>".$sanket[6]."<br>";
?>
</STRONG>
</body>
</html>

PROGRAM TO PRINT TABLE OF 5 IN PHP

INPUT:
<html>
<head><h1> Table of 5 till 20. </h1></head>
<?php
$sanket=1;$b=5;$c;
for($sanket=1;$sanket<=20;$sanket++)
{
$c=$b*$sanket;
echo "<b>5*".$sanket."=".$c."<br></b>";
}
?>
</head>
</html>

DETERMINE WHETHER A NUMBER IS PRIME OR NOT IN PHP

INPUT:
<html>
<head><h1> Check whether the numbers are prime or not .</h1></head>
<body>
<H1>
<?php
$c;$sanket;$x;
for($x=2;$x<=100;$x++)
{
$c=0;
for($sanket=2;$sanket<=($x/2);$sanket++)
{
if(($x%$sanket)==0)
$c++;
}
if($c==0)
{
echo $x." is a prime number<br>";
}
else
{
echo $x." is not a prime number<br>";
}
}
?>
</h1>
</body>


</html>

FIBONACCI SERIES IN PHP

INPUT:
<html>
<head><h1>Fibonacci series.</h1></head>
<body>
<H1>
<?php
$sanket1;$sanket2=0;$sanket3=1;$sanket4;
echo $sanket2."<br>";
echo $sanket3."<br>";
for($sanket1=2;$sanket1<=9;$sanket1++)
{
$sanket4=$sanket2+$sanket3;
$sanket2=$sanket3;
$sanket3=$sanket4;
echo $sanket4."<br>";
}
?>
</h1>
</body>
</html>

FACTORIAL IN PHP

   INPUT:
<html>
<body>
<H1>
<?php
$sanket1;$sanket2=1;
for($sanket1=1;$sanket1<=5;$sanket1++)
$sanket2=$sanket2*$sanket1;
echo "factorial of 5 = ".$sanket2;
?>
</h1>
</body>
 </html>

DISPLAY EVEN NUMBERS BETWEEN 1 TO 100 IN PHP


   INPUT:
<html>
<head><h1> Display even numbers between 1 to 100.</h1></head>
<body>
<H1>
<?php
$sanket;
for($sanket=1;$sanket<=100;$sanket++)
{
if($sanket%2==0)
{
echo $sanket."<br>";
}
}
?>
</h1>
</body>


</html>

DISPLAY NUMBERS FROM 1 TO 10 USING CONTINUE IN PHP


   INPUT:
<html>
<head><h1> Display numbers from 1 to 10 using <strong><i>Continue</i></strong> statement.</h1></head>
<body>
<H1>
<?php
$sanket;
for($sanket=1;$sanket<=10;$sanket++)
{
if($sanket==5)
{
continue;
}
echo $sanket."<br>";
}
?>
</h1>
</body>


</html>

DISPLAY NUMBERS FROM 1 TO 10 USING DO-WHILE LOOP IN PHP

INPUT:
<html>
<head><h1> Display numbers from 1 to 10 using <strong><i>Do-while loop</i></strong></h1>          </head>
<body>
<H1>
<?php
$sanket=1;
do
{
echo $sanket."<br>";
$sanket++;
}
while($sanket<=10)
?>
</h1>
</body>


</html>

DISPLAY NUMBERS FROM 1 TO 10 USING WHILE LOOP IN PHP

            INPUT: 

<html>
<head><h1> Display numbers from 1 to 10 using <strong><i>while loop</i></strong></h1></head>
<body>
<H1>
<?php
$sanket=1;
while($sanket<=10)
{
echo $sanket."<br>";
$sanket++;
}
?>
</h1>
</body>
</html>


  

ADDING TWO NUMBERS IN PHP


INPUT:
<html>
<head><h1>Addition Of Two Numbers</h1></head>
<body>
<H1>
<?php
$sanket1=5;
$sanket2=15;
$sanket3=$sanket1+$sanket2;
echo "a =".$sanket1."<br>b =".$sanket2."<br>c =".$sanket3;
?>
</h1>
</body>
</html>

DISPLAY NUMBERS FROM 1 TO 10 USING FOR LOOP IN PHP

          INPUT:
<html>
<head><h1> Display numbers from 1 to 10 using <strong><i>for loop</i></strong></h1></head>
<body>
<H1>
<?php
$sanket;
for($sanket=1;$sanket<=10;$sanket++)
{
echo $sanket."<br>";
}
?>
</h1>
</body>
</html>