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>