Tuesday, March 31, 2009

Abstract class and abstract method with example in php

In php, you can define a class as abstract class. In fact if you want to keep any method of a class as abstract that class must be declared as abstract class. So, there is both abstract classes and abstract methods.

A class defined as abstract class can't be instantiated, which means we can't create instance of that class but it can be subclassed. If methods are declared as abstract then they can't conatin implementation, that means without any braces and followed by semicolon(;) like,
abstract protected function display();

Abstract class may or may not include abstract methods.

When a subclass is inherited from abstract class all methods marked as abstract class declaration in the parent must be defined in the subclass.

The scope of the derived class method must be less restrictive than the scope of the base class method if it is declared as abstract method. For example, if base class abstract method is declared as protected then within derived class method or in other word the function implementation must be defined as either protected or public, but not private.

Below is an example of abstract class and abstract method in php,

<?php
abstract class AbstractClass{
//Only abstract class declartion here. Implementation must be inside subclass
abstract protected function abstractTest1();
abstract protected function abstractTest2($suffix);
public function display(){
echo $this->abstractTest1();
}
}

class SubClass1 extends AbstractClass{
protected function abstractTest1(){
return "SubClass1";
}
public function abstractTest2($suffix){
return "SubClass1 ".$suffix;
}
}
class SubClass2 extends AbstractClass{
public function abstractTest1(){
return "SubClass2";
}
public function abstractTest2($suffix){
return "SubClass2 ".$suffix;
}
}

$subclass1Instance=new SubClass1();
$subclass1Instance->display(); //Protected method can be called here.
echo "<br />";
echo $subclass1Instance->abstractTest2("Class1");
echo "<br />";
$subclass2Instance=new SubClass2();
echo $subclass2Instance->abstractTest1(); //As we declared public so can be access here.
echo "<br />";
echo $subclass2Instance->abstractTest2("Class2");

?>

An the output is,

SubClass1
SubClass1 Class1
SubClass2
SubClass2 Class2

Related Documents
http://arjudba.blogspot.com/2009/03/static-declaration-with-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html

Static declaration with example in php

In php, you can declare method or member of a class as static. If you do so then you can access the method/member without creating any instance.

In fact, if you declare a member of a class as static then that member can't be accessed with an instantiated class object. So you would not be able to access a static variable using arrow sign. However static method can be accessed via instantiation.

Another thing about static method is, the pseudo variable $this is not available inside the method declared as static.

Below is an example of static declaration with example in php.

<?php
class StaticExample{
static $staticVariable=10;
static function staticMethod(){
echo "This method is declared as static";
}
}
echo StaticExample::$staticVariable;
echo "<br />";
StaticExample::staticMethod();
echo "<br />";
$staticExampleInstance=new StaticExample();
$staticExampleInstance->staticMethod();
echo "<br />";
echo $staticExampleInstance->staticVariable; //This is undefined, so no output will be displayed.
?>

And in browser the output is,

10
This method is declared as static
This method is declared as static

Related Documents
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html

Monday, March 30, 2009

Public, protected and private scope in php

Prepend the public or private or protected keyword before a variable declaration define the scope of the variable.

If the variable is declared as public then that variable can be accessed from anywhere.

If the variable is declared as proteced then that variable can be accessed from parent class and inherited classes and the class that define the variable.

If variable is declared as private then it is only available within the class that defines it.

If neither public/private/protected keyword are specified in declaration then by default the method/variable becomes public.

Below is an example with these keywords.

<?php
class BaseClass{
public $publicVar='Public Variable ';
protected $protectedVar='Protected Variable ';
private $privateVar='Private Variable';

public function display(){
echo $this->publicVar;
echo $this->protectedVar;
echo $this->privateVar;
}
}

class DerivedClass extends BaseClass{
protected $protectedVar2='Protected Variable 2';


function display(){
echo $this->publicVar;
echo $this->protectedVar;
echo $this->protectedVar2;
echo $this->privateVar;
}
}
$baseInstance=new BaseClass();
echo $baseInstance->publicVar; //It will work as public
echo "<br />";
//echo $baseInstance->protectedVar; //Fatal error as protected can be accessed within base and derived class.
//echo "<br />";
//echo $baseInstance->privateVar; //Fatal error as private can be accessed within it's own class
//echo "<br />";
echo $baseInstance->display(); //show all three as display is the method of the class.
echo "<br />";

$derivedInstance=new DerivedClass();
echo $derivedInstance->display(); //private variable of base class will not be shown.
?>

And the output is,

Public Variable
Public Variable Protected Variable Private Variable
Public Variable Protected Variable Protected Variable 2

Related Documents
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html
http://arjudba.blogspot.com/2009/03/constructors-and-destructors-in-php.html

Constructors and Destructors in php

From php5, constructors method can be declared within class. If you have declared a constructor in a class that the constructor method will be automatically called during creation of an instance of the class. So, you can declare a constructor whenver you think the initialization of an object must needed everytime after an instance is created.

Note that, you have both parent and child constructor corresponding to parent and child table. If you create an instance of the child table, parent constructor is not called implicitly. To call the parent constructor while creating child object, within child constructor you have to call parent constructor explicitly. Constructor is declared by keyword __construct (note that double underscore(__) is prepend before construct) and calling the parent constructor is done by parent::__construct().

As constructor is created for some initialization of the object, destructor comes for to destroy the object. Or in other word destructor is used to release any resources allocated by the object. The destructor method will be called as soon as all references to a particular object are removed or when the object is explicitly destroyed or in any order in shutdown sequence.

Below is an example of using both constructor and destructor.

<?php
class ParentClass {
function __construct(){
echo "This is the parent constructor. ". get_class($this);
echo "<br />";
}
}
class ChildClass extends ParentClass{
function __construct(){
echo "This is the child constructor. ".get_class($this);
echo "<br />";
}
function __destruct() {
echo "Destroying child object ";
}
}
$childInstance=new ChildClass();
?>

And the output on the browser is,

This is the child constructor. ChildClass
Destroying child object

Note that parent constructor is not called with the creation of child instance. In other to do so we have to call it within child constructor as shown below.

<?php
class ParentClass {
function __construct(){
echo "This is the parent constructor. ". get_class($this);
echo "<br />";
}
}
class ChildClass extends ParentClass{
function __construct(){
parent::__construct();
echo "This is the child constructor. ".get_class($this);
echo "<br />";
}
function __destruct() {
echo "Destroying child object. ". get_class($this);
}
}
$childInstance=new ChildClass();
?>

And output is below.

This is the parent constructor. ChildClass
This is the child constructor. ChildClass
Destroying child object. ChildClass

Related Documents
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/autoloading-objects-in-php.html

Sunday, March 29, 2009

require_once and include_once in php

The include_once parameter is almost same as include and the require_once parameter is almost same as require. Both of require and include is described with example in http://arjudba.blogspot.com/2009/03/require-and-include-parameter-in-php.html. The only difference from include and require is that with require_once/include_once if the file is already included, it will not include again.

For example, if within your script you use below code then behavior will depend based on php version and OS type.

<?php
include_once 'test.php';
include_once 'Test.php';
?>

As of php 4.0 once test.php is included and then again Test.php is included regardless of OS. For case insensitive OS both test.php and Test.php point just one file but they are included twice. This behavior is changed in php 5.0. From php 5.0, on case insensitivity OS for example on windows machine test.php is included only once. But on unix file system they are included in each test.php and Test.php as they represent two different files.

Related Documents
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html
http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html
http://arjudba.blogspot.com/2009/03/require-and-include-parameter-in-php.html

Require and Include parameter in Php

Suppose you have two php files named class1.php and class2.php and now from class1.php file you need to access the class class2 which is defined under class2.php.

With both include and require command you can include the class2.php and then uses the classes, objects, variables defined under class2.php.

Both "include" and "require" commands are almost identical except about how they handle failures. Both of them generates warning (E_WARNING) upon failure. But "require" results fatal error (E_ERROR) upon missing file and thus halt processing of the page. In contrast, "include" does processing rest of the lines of the file after issuing warning.

So if you want to process rest of the lines of the file after missing file then use include. If you want to halt processing rest of the lines of the file then use require.

Following is an example.

My class2.php file contents,

<?php
$test1="Momin";
$test2="Arju";
class Class2{
function display(){
echo "This is include/require test";
}
}
?>

And my class1.php file contents,

<?php
require 'Class2.php';
echo "It is in Class1: Variable from class2 $test1 $test2";
echo "<br />";
$class1Instance=new Class2();
$class1Instance->display();
?>

Now in browser class1.php displays,
It is in Class1: Variable from class2 Momin Arju
This is include/require test

Let's now change the class1.php file as below:

<?php
require 'Classnotfound.php';
echo "It is in Class1: Variable from class2 $test1 $test2";
echo "<br />";
$class1Instance=new Class2();
$class1Instance->display();
?>

Now on broswer running class2.php fails with message,
Warning: require(Classnotfound.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\class1.php on line 2

Fatal error: require() [function.require]: Failed opening required 'Classnotfound.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\class1.php on line 2

Replacing require by include and see the differences.

<?php
include 'Classnotfound.php';
echo "It is in Class1: Variable from class2 $test1 $test2";
echo "<br />";
$class1Instance=new Class2();
$class1Instance->display();
?>

Warning: include(Classnotfound.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\class1.php on line 2

Warning: include() [function.include]: Failed opening 'Classnotfound.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\class1.php on line 2
It is in Class1: Variable from class2

Fatal error: Class 'Class2' not found in C:\xampp\htdocs\class1.php on line 5

Note that include display echos under class1.php but require does not.
Related Documents
http://arjudba.blogspot.com/2009/03/class-inheritance-example-in-php.html

http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html

Autoloading Objects in php

You may have one php source file per class definition. For example Class1.php file contains Class1 definition, Class2.php contains Class2 definition, Class3.php conatins Class3 definition, etc. So to use those classes under different files you need to write a series of includes/ requires statements. In case of class/variable/method is not found it will search within the files mentioned inside includes/requires.

Sometimes so many includes/requires may be of pain tasks.

With php 5.0, you can avoid to include a list of includes/requires. You can use __autoload function and with this __autoload function the file will be automatically called in case you are trying to use a class/interface which hasn't been defined yet.

Note that exception thrown inside __autoload function can't be caught by catch block.

Below is an example of __autoload function.
My Class1.php

<?php
class Class1{
public $a=1000;
}
?>

My Class2.php

<?php
$test1="Momin";
$test2="Arju";
class Class2{
function display(){
echo "This is include/require test";
}
}
?>

My autoloading.php

<?php
function __autoload($className){
require_once $className.'.php';
}
$class1Instance=new Class1();
echo $class1Instance->a;
echo "<br />";
$class2Instance=new Class2();
$class2Instance->display();
?>

If I run autoloading.php in the browser it will show,
1000
This is include/require test

Related Documents
http://arjudba.blogspot.com/2009/03/requireonce-and-includeonce-in-php.html
http://arjudba.blogspot.com/2009/03/require-and-include-parameter-in-php.html 

Saturday, March 28, 2009

Class inheritance example in Php

With a simple example you can understand the inheritance concept. Think about Human class. All human have mouth, can eat, have nose etc. If you say Man class, all Man subclass inherits the characters of Human parent class plus has his own characteristics. Similarly female subclass inherits Man parent class.

Inheritance indicates the relationship between classed. If we have a generic class and another class inherits the generic class then the derived class inherit the attributes and behaviors from their parent classes, and can introduce their own. The derived class is the more specialized version of the parent class.

With the extends keyword in declaration subclass is defined. Note that a subclass can only inherits one base class. If the parent class is not defined as final then inside the subclass inherited methods and attributes can be overridden. To access the parent class methods and attributes parent:: keyword can be used.

Below is the class inheritance example in php.

<?php
class BaseClass{
function display(){
echo "This is base class.";
echo "<br />";
}
}

class DerivedClass extends baseClass{
function display(){
echo "This is derived class.";
echo "<br />";
parent::display();
}
}
$derivedclass=new DerivedClass();
$derivedclass->display();
?>


And the output is,
This is derived class.
This is base class.

Related Documents

http://arjudba.blogspot.com/2009/03/class-concepts-and-usage-syntax-in-php.html

Class concepts and usage syntax in php

In php5 handling of objects is completely re-written and more features of object oriented concept is added. In this post I will write basic class definition and accessing variables, methods syntax.

Before proceed let's have an idea what is called class. A class is an abstract characteristics of a thing which includes thing's characteristics (properties) plus thing's behavior (operations).

In programming aspect a class contains a list of variables and functions. Variables represent attributes and functions represent what class objects can do.

Every class definition begins with the keyword class, followed by a class name, followed by a pair of curly braces. Within the braces class members and methods are defined. A pseudo-variable $this can be used within the class method which indicates the references to the calling object.

Note that $this variable is available if class method is called after creating a new instance. This can be also another object's instance. Without creating instance, if a method is called directly then $this variable will not be available.

Below is a simple example of usage class in php.

<html>
<body>
<?php
class MyClass1{
function display(){
if(isset ($this)){
echo '$this is defined = ';
echo get_class($this);
echo "<br />";
}else {
echo '$this is not defined.';
echo "<br />";
}

}
}

class MyClass2{
function display2(){
MyClass1::display();
}
}

$myclass1=new MyClass1();
$myclass1->display(); //$this will be available as function is called from an object context.
MyClass1::display(); //As we are not creating instance here so $this will not be available.

$myclass2=new MyClass2();
$myclass2->display2(); //$this will be available as function is called from an object context.
MyClass2::display2(); //As we are not creating instance here so $this will not be available.
?>
</body>
</html>


The output is,

$this is defined = MyClass1
$this is not defined.
$this is defined = MyClass2
$this is not defined.

Related Documents

Sunday, March 22, 2009

Control Structures in php

Php uses various control structures. The control structure used in php along with some examples are noted below.

1)if : If the expression specified within "if statement" evaluates to TRUE then PHP will execute statement, and if it evaluates to FALSE if block is ignored.
A simple example,

<?php
if ($a > $b)
echo "The value of a variable is bigger than the value of b variable";
?>

2)else : If the condition inside if statement is not met then else block is executed.

<?php
if ($a > $b) {
echo "A value is greater than B value.";
} else {
echo "A value is not greater than B value.";
}
?>

3)elseif/else if: "elseif" / "else if" extends the if statement to execute a different statement in case the original if expression evaluates to FALSE.
The following is an example:

<?php
if ($x > $y) {
echo "x is bigger than y";
} elseif ($x == $y) {
echo "x is equal to y";
} else {
echo "x is smaller than y";
}
?>

Note that elseif /else if is same if brace is used. The only difference is "else if" can't be used if colon is used. Below is an example that will show the difference between elseif and elseif.

<?php
//This one is incorrect
$x=3;
$y=2;
if($x>$y): echo "x is greater than y";
else if ($x==$y): echo "both are equal";
else: echo "y is greater than x";
endif;
?>

Parse error: parse error, expecting `':'' in C:\xampp\htdocs\Elseif.php on line 6

<?php
//This one is correct
$x=3;
$y=2;
if($x>$y): echo "x is greater than y";
elseif ($x==$y): echo "both are equal";
else: echo "y is greater than x";
endif;
?>

x is greater than y

4)while: As long as the while expression evaluates to true, the statement inside while statement executes. Below is an example.

<?php
$a=10;
while ($a<15){
echo $a;
$a++;
}
?>

This will print 1011121314 in the browser.

5)Do .. while: Almost same as while loop but it ensures that at least one time the statement will be executed as the checking is done at the end of the iteration.

Below is an example.

<?php
$a=10;
do{
echo $a;
}while ($a>14);
?>

It will print 10 in the browser.

6)for : The syntax of for loop is,
for (expr1; expr2; expr3)
statement

The first expression (expr1) is executed once at the beginning of the loop.

In the beginning of each iteration, expr2 is evaluated. If it evaluates to TRUE, the loop continues. Loop terminate whenever this expression evaluates to FALSE. If multiple expression is given in expr2 checking is done by AND operation between them.

At the end of each iteration, expr3 is executed.

Below is an example of for loop which will print 20 in the browser.

<?php
for ($a=20,$b=5;$a>10, $b<6;$a++, $b++)
echo $a;
?<


7)foreach: foreach construct is specially made to handle arrays. For normal variables it can't be used. When foreach first starts executing, the internal array pointer is automatically reset to the first element of the array.
The following example will produced output 1234.

<?php
$numarr=array(1,2,3,4);
foreach ($numarr as $value){
echo $value;
}
?>

8)break: break ends execution of the current for, foreach, while, do-while or switch structure. With break you can supply a numeric number which tells how many structure it will end. For example,
while(){
switch(){
case 1:
break 2;
case 2:
break 1;
}
}
In this case break 2 will exit both the switch and while.
break 1 will only exit switch.

9)continue: Continue is used within looping structures and do following.
-Skip the rest of the current loop iteration.
-Evaluates the condition.
-Increase the iteration number by 1.

As of switch statement, continue statement also take numeric number.

10)switch: The switch statement is similar to a series of IF statements but constructs is different.
Below is an example of switch .. case which will display a is 3 on the browser.

<?php
$a=3;
switch($a){
case 1:
echo "a is 1";
break;

case 2:
echo "a is 2";
break;

case 3:
echo "a is 3";
break;

default:
echo "a is neither 1 nor 2 nor 3";
}
?>

11)return: If return is used inside function, statement immediately ends execution of the current function, and returns its argument as the value of the function call. Note that return is not a function. If you use return($a) then value of variable a is returned.

12)goto: The goto operator can be used to jump to other instruction in the program. --The target place is specified by the label and a colon.
-goto is followed by that label.
Below is an example which will print "Goto statement test" in the browser.

<?php
goto l;
echo "This will not execute";

l:
echo "Goto statement test";
?>

Note that the goto operator is available since PHP 5.3.

Friday, March 20, 2009

Image processing in php with exif extension

With the exif (Exchangeable Image Information) extension in php you can work with image meta data. Whenever you use any digital camera and take an image meta data information is stored in the image (like image type, resolution, size etc). With php you can extract that information.

Requirements to use exif extention
To enable exif-support, configure PHP with --enable-exif on unix platform.
If you are on windows platform then uncomment the
php_mbstring.dll and
php_exif.dll DLL's in php.ini. Be sure that php_mbstring.dll DLL must be loaded before the php_exif.dll DLL.

List of exif functions
1)exif_imagetype: It read metadata information from image and determines the type of the image (like jpg, gif, bmp etc). The syntax is,
int exif_imagetype ( string $filename );
The possible return values are,

Value Constant
1 IMAGETYPE_GIF
2 IMAGETYPE_JPEG
3 IMAGETYPE_PNG
4 IMAGETYPE_SWF
5 IMAGETYPE_PSD
6 IMAGETYPE_BMP
7 IMAGETYPE_TIFF_II (intel byte order)
8 IMAGETYPE_TIFF_MM (motorola byte order)
9 IMAGETYPE_JPC
10 IMAGETYPE_JP2
11 IMAGETYPE_JPX
12 IMAGETYPE_JB2
13 IMAGETYPE_SWC
14 IMAGETYPE_IFF
15 IMAGETYPE_WBMP
16 IMAGETYPE_XBM

You can access image type by CONSTANTS also. If the function could not find any it will return FALSE.

2)exif_read_data: This functions returns many information like height, width, digital camera information, copyright information etc of the image after reading the header info of the image.
The syntax is,
array exif_read_data (string $filename , [string $sections= NULL] , [bool $arrays= false] , [bool $thumbnail= false]);

file_name -is the name of the image file for which you want to extract information.
sections part is the combination of

FILE (FileName, FileSize, FileDateTime, SectionsFound)
COMPUTE (html, Width, Height, IsColor, and more)
IFD0 (Image size and others)
THUMBNAIL
COMMENT (Comment headers of JPEG images.)
EXIF (detail info of the image)

arrays -sepecify whether each section becomes an array)

thumbnail- If true then thumbnail itself is read.

3)exif_tagname: It takes image index and return header name.
The syntax is, string exif_tagname ( int $index );

4)exif_thumbnail: It retrieves the embedded thumbnail of either tiff or jpeg type image.
The syntax is,
string exif_thumbnail(string $filename, [int &$width], [int &$height,[int &$imagetype);

5)read_exif_data: It is same as exif_read_data.

All these examples are given in the post

Access violation at address in module libmysql.dll. read of address 00000000

Problem Description
You have installed XAMPP and it was working fine. After restarting your windows it appeared "access violation at address 10002832 in module 'LIBMYSQL.dll'. Read of address 00000000" message popping up over and over again.

Even when you stop the MySql service in the XAMPP panel the messages keep on coming about one every 10 seconds.

But whenever you right-click on the traffic-light in the list of running programs and choose "Win NT>shutdown this tool" then everything works fine again after starting up the MySql service in the XAMPP control panel.

Cause of the Problem
In XAMPP installation MySQL by default install with the user root with no password. Later you changed password of WinMySQLAdmin but the change did not affect in MySQL and hence above pop up windows appears.

Solution of the Problem

1) Open WinMySQLamin. You can usually find it as traffic light on the taskbar. Right click on it and select show me.

2) On the Environment tab select "Set Server's Query Interval". A pop up window will appear. In the "Interval Query Setup" pop up window set a bigger value like 100.

3)Click on "my.ini setup" tab on your WinMySQLamin. In the box you will see password field. Make it null that means remove password from there.

4)Then click "save modification" on the left. Pop up window will appear and save it.

At this stage I hope your problem is disappeared and no pop up window is coming.

If the solution works for you then you have the two options to think.

1. If you are satisfied with it that is leaving password field blank of root user then nothing you need to do. Though it is bad practice to set root password blank.

2. Leave winMySQLAdmin like it is, and rather go and change MySQL to have root and password of the password that is set in WinMySQLAdmin.

Operators in php

In simple definition an operator is something that takes one or more values and generates another value. Operators can be of three types.

1)Unary Operator: Which operates on just one value. Like incremental operator (++) or negation operator(!).

2)Binary Operator: Which operates on two values. In php most of the operators are binary operators. Like +, -, * etc.

3)Ternary Operator: Which operators on three values. Example is ? : combination.
like, the expression (expr1) ? (expr2) : (expr3) evaluates to expr2 if expr1 evaluates to TRUE, and expr3 if expr1 evaluates to FALSE.

Based on the operator functionality it can be categorized into following:
1) Arithmetic Operators: Some basic arithmetic operator falls within this category.
Examples are -(negation -$a), +(addition $a+$b), -(subtraction $a-$b), * (multiplication $a*$b), division ($a/$b), modulus ($a%$b) where a and b are both variable. Note that Remainder $a % $b is negative for negative $a.

2) Assignment Operators: The = (equal sign) is the basic assignment operator. Whenever you write $a=$b it mean value of right hand variable b(operand) will be assigned to the left hand variable a.

3) Bitwise Operators: There are several bitwise operator that operates bit by bit between operands. These operators are below and beside the operator is the result.

& (bitwise AND - bit is set if both operands are set)
| (bitwise OR - bit is set if any of the operand is set)
^ (bitwise XOR - bit is set if bit is set in either of the operands but not when both are set)
~ (NOT) - bit is set if it is not set in the operator and vice-versa.
<< (Shift Left) - &a<<&b means shifts the bit of $a by $b steps to the left. >> (Shift Right) - &a>>&b means shifts the bit of $a by $b steps to the right.

4) Comparison Operators: Comparison operators are for comparing between two values. They returns boolean value.
Examples are,
== ($a==$b returns true if $a is equal to $b)
=== ($a===$b returns true if $a is equal to $b and $a has the same datatype as of $b)
!= or <> ( $a!=$b or $a<>$b will return true if $a is not equal to $b)
!==($ a!== $b will return true if $a is not equal to $b, or they are not of the same type.
< ($a < $b will return true if $a is less than $b.) > ($a > $b will return true if $a is strictly greater than $b.)
<= ($a <= $b will return true if $a is less than or equal to $b.) >= ($a >= $b will return true if $a is greater than or equal to $b.

5) Error Control Operators: The @ (at sign) is error control operator in php. If @ is prepend to variables, function, include() calls, constants then any error messages that might be generated by that expression will be ignored.

If the track_errors feature is enabled- which can be enabled by setting TRACK_ERRORS, any error message generated by the expression will be saved in the variable $php_errormsg. This variable will be overwritten on each error occurs.

6) Execution Operators: With php OS command can by executed by execution operator. If the commands are within backticks (` `) then PHP will attempt to execute the contents of the backticks as a shell command. Example is echo `ls -l`.

The backtick operator is disabled when safe mode (safe_mode =ON) is enabled or shell_exec() is disabled.

7) Incrementing/Decrementing Operators: Four incremental/decremental operators there.
++$a : Increments $a by one, then returns $a.
$a++ : Returns $a, then increments $a by one.
--$a : Decrements $a by one, then returns $a.
$a-- : Returns $a, then decrements $a by one.

8) Logical Operators:
AND : $a and $b becomes TRUE if both $a and $b are TRUE.
OR : $a or $b becomes TRUE if either $a or $b is TRUE.
XOR : $a xor $b becomes TRUE if either $a or $b is TRUE, but not both.
! : ! $a becomes TRUE if $a is not TRUE.
&& : $a && $b becomes TRUE if both $a and $b are TRUE.
|| : $a || $b becomes TRUE if either $a or $b is TRUE.

9) String Operators: One string type operation is concatenation(.) operator that concatenate it's left and right arguments. Another one is concatenating assignment operator ('.='), which appends the argument on the right side to the argument on the left side.

10) Array Operators: They work on array and examples are +,==,===, !=, <>,!== .

11) Type Operators: Example is, instanceof - which can be used to determine whether a variable is an instantiated object of a class.

Thursday, March 19, 2009

Magic constants in php

In php there are many predefined constants. Normal constant value is not changed but out of the many predefined constants seven constants value are changed based on the usage inside the script. These seven constants are called magic constants.

Their description are as below.

1)__LINE__ : This constant prints the current line number of the file.

2)__FILE__ : __FILE__ prints the absolute path of the file. If it is used inside an include, the name of the included file is returned.

3)__DIR__ : It prints the directory name of the file. If used inside an include, the directory of the included file is returned. Note that trailing slash is not there without unix root (/) directory.

4)__FUNCTION__ : It returns the function name. In PHP 5 it is case sensitive but in PHP version 4 its value was always lowercased.

5)__CLASS__ : It returns the class name. In PHP 5 it is case sensitive but in PHP version 4 its value was always lowercased.

6)__METHOD__ : It prints the class method name.

7)__NAMESPACE__ : It returns the name of the current namespace (case-sensitive). This constant is defined in compile-time (Added in PHP 5.3.0).

Code

<html>
<body>
<?php
echo "This example will show about magic constants." ;
echo "<br />";
echo "This is line number: ". __LINE__;
echo "<br />";
echo "This is file name: ". __FILE__;
echo "<br />";

class MyBaseClass
{
function function_a()
{
echo "A function called -" . __CLASS__ . "<br/>";
}

function function_b()
{
echo "B function called -" . get_class($this) . "<br/>";
}

}

class MyDerivedClass extends MyBaseClass
{
function function_a()
{
parent::function_a();
echo "A function called --" . __CLASS__ . "<br/>";
}

function function_b()
{
parent::function_b();
echo "B function called --" . get_class($this) . "<br/>";
echo "This is a function: " .__FUNCTION__ ."<br/ >";
}
}

$object_b = new MyDerivedClass();

$object_b->function_a();
echo "<br/>";
$object_b->function_b();
echo "<br />";
echo "<br />";
?>
</body>
</html>


Output
This example will show about magic constants.
This is line number: 6
This is file name: C:\apache2triad\htdocs\magic_constants.php
A function called -MyBaseClass
A function called --MyDerivedClass

B function called -MyDerivedClass
B function called --MyDerivedClass
This is a function: function_b

Related Documents
Working with cookie in php(set, retrieve, delete)
Accessing data from html forms in php
Track error messages on php
Array declaration, assignment and printing in php
Variables in PHP
Constants in php

Wednesday, March 18, 2009

Constants in php

  • Constant can be defined by using the define() function or by using the const keyword outside the class definition as of php 5.3.0.
  • Constant is different from variables in php. To access variable you must use $ prepend but to access constant you should not prepend with a $. With function constant() constant value can also be retrieved.
  • Constants can't be redefined or undefined once they have been set.
  • Unlike variables constants value is not locale. You can access from anywhere within the script.
  • A simple example is below.

<?php
define("myCONSTANT", "This is a constant.");
echo myCONSTANT;
?>

which will print output,
This is a constant.


Related Documents
Working with cookie in php(set, retrieve, delete)
Accessing data from html forms in php
Track error messages on php
Array declaration, assignment and printing in php
Variables in PHP
Magic constants in php

Working with cookie in php(set, retrieve, delete)

Cookies are the mechanism for storing data in the browser machine and thus tracking the user. With php you can set, retrieve and delete cookies.

Set Cookie:

With the setcookie() function you can send cookie to the browser. The syntax of this function is,
bool setcookie(name, value, expire, path, domain, secure, httponly);

where name is the name that you name the cookie.

value is the information that to be stored in the browser's computer.

expire defines the time the cookie expires.
path term is related to server which indicates the domain that the cookie will be available for. If you set to '/', the cookie will be available within the entire domain. The default value is the current directory that the cookie is being set in.

domain sets whether cookie will be available to subdomain. If you set ".test.com" /"test.com" then in all subdomains of test.com cookie will be available. If you set "mail.mytest.test.com" then the cookie will be available under mail.mytest.test.com subdomain.

secure - which is set to FALSE by default. If it is set then cookie will be only transmitted if it get HTTPS secure connection.

httponly
- If it is set to true cookie will only be accessible for http connection. For scripting language cookie will not be available.

setcookie() function must be placed on the script prior to any output. So it means before <html> tags as well as any whitespaces.

Following is a declaration of a cookie which specifies cookie name will be myCookie, value to be assigned is "Abdul Momin Arju" and after 1 hours cookie should be expired.

<?php
setcookie("myCookie", "Abdul Momin Arju", time()+3600);
?>


The value of the cookie is automatically URLencoded when sending the cookie, and automatically decoded when received. In order to prevent URLencoding, use setrawcookie() function.

Retrieve a Cookie value
Cookie can be accessed by variables $_COOKIE or $_REQUEST or $HTTP_COOKIE_VARS arrays.

Delete a cookie:

When deleting a cookie you should assure that the expiration date is in the past, to trigger the removal mechanism in your browser.
Example:
<?php
// set the expiration date to one hour ago
setcookie ("TestCookie", "", time() - 3600);
?>


The following is an example of set cookie value and displaying on cookie info in the browser.
<?php
$value = 'My Cookie Value';
setcookie("myCookie", $value, time()+3600);
?>


<?php
// Print individual cookie
echo $_COOKIE["myCookie"];
echo $HTTP_COOKIE_VARS["myCookie"];
//print_r($_COOKIE); --For debugging
?>

Related Documents
Working with cookie in php(set, retrieve, delete)
Accessing data from html forms in php
Track error messages on php
Array declaration, assignment and printing in php
Variables in PHP
Constants in php
Magic constants in php

Accessing data from html forms in php

Whenever a form is submitted to php, the information from the form is automatically available to php. Php then process the information of the form.

There are several ways to access the html form data into php.

1)Using $_GET, $_POST and $_REQUEST variable:
The $_GET variable is used to collect values from a form with method="get" .

When using the $_GET variable all variable names and values are displayed in the URL.

With GET method in form maximum 100 characters can be send.

The $_GET method is useful for bookmark.

The $_POST variable is used to collect values from a form with method="post". In the url the values are not shown, so this method would be used to pass sensitive information to the server.

The PHP $_REQUEST variable contains the contents of both $_GET, $_POST, and $_COOKIE.

The PHP $_REQUEST variable can be used to get the result from form data sent with both the GET and POST methods.

2)Using $HTTP_POST_VARS variable. But it would be used because this variable may be disabled.

3)By setting the PHP directive register_globals to ON. From PHP 4.2.0 and onwards this variable default value is changed from ON to OFF. This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. So don't rely on this feature.

Below is the simple html form. Whenever you click submit button process_form.php will be called.

<html>
<title>Simple Testing of Reading forms</title>
<body>
<form action="process_form.php" method="post">
Your Name: <input type="text" name="name"><br />
Age: <input type="text" name="age"><br />
Class: <select name="Classes">
<option value="6">Six</option>
<option value="7">Seven</option>
<option value="8">Eight</option>
<option value="9">Nine</option>
<option value="10">Ten</option>
</select> <br />
<input type="submit" value="submit" name="submit">
</form>
</body>
</html>

Here is the process_form.php code.

<html>
<body>
<?php
echo "Your name is" . $_POST["name"] . " and you are". $_POST["age"] ." years old.
You read in class ". $_POST["Classes"];
?>
</body>
</html>

Related Documents
Working with cookie in php(set, retrieve, delete)
Accessing data from html forms in php
Track error messages on php
Array declaration, assignment and printing in php
Variables in PHP
Constants in php
Magic constants in php

Tuesday, March 17, 2009

Running perl fails perl lib version doesn't match executable version

Problem Description
Whenever you wish to use perl it did not run failing with perl lib version doesn't match executable version. Even it happens whenever you wish to know the version of the perl as shown below.
C:\>perl.exe -V
Perl lib version (v5.8.3) doesn't match executable version (v5.8.7) at E:\oracle\product\10.2.0\db_1\perl\5.8.3\lib/MSWin32-x86-multi-thread/Config.pm line 32.
Compilation failed in require.
BEGIN failed--compilation aborted.

Cause and Solution of the Problem:
As the error indicates executable version of perl(perl.exe) does not match it library version which is under MSWin32-x86-multi-thread/Config.pm. This is a possible problem if you install perl two times that have different version in your hand. Note that many software includes perl software. So if you install other software then perl can be integrated with it. If you have oracle database then already perl is there. If you install any web (server+ php) then perl may be integrated with the installation.

The solution is use the same perl executable version as of library version. Suppose if I select executable version of 5.8.3 then it will solve my problem.

C:\>E:\oracle\product\10.2.0\db_1\perl\5.8.3\bin\MSWin32-x86-multi-thread\perl.exe -V
Summary of my perl5 (revision 5 version 8 subversion 3) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86-multi-thread
uname=''
config_args='undef'
hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:

Track error messages on php

It is common in php that you write codes but whenever you tried to display on the web browser it displays nothing even a html. You want to know the behind where actually problem occurs. In which line or in which part of the code. The error_reporting function will help in this case really well.

Below is an example which is written to display directory contents inside c:\Documents and Settings folder but at the end on the browser it displayed nothing. You by enabling error reporting I might wish the say what actually happening there.

Code

<html>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', true);
$fileHandler = opendir('C:\Documents and Settings');
while (false !== ($file = readdir($filehandler))) {
$files[] = $file;
}
sort($files);
print_r($files);
closedir($filehandler);
?>
</body>
</html>


Output

Notice: Undefined variable: filehandler in C:\apache2triad\htdocs\array_file.php
on line 8

Warning: readdir(): supplied argument is not a valid Directory resource in
C:\apache2triad\htdocs\array_file.php on line 8

Warning: sort() expects parameter 1 to be array, null given in
C:\apache2triad\htdocs\array_file.php on line 11

Notice: Undefined variable: filehandler in C:\apache2triad\htdocs\array_file.php
on line 13

Warning: closedir(): supplied argument is not a valid Directory resource in
C:\apache2triad\htdocs\array_file.php on line 13


Based on the output you are aware that there is problem with variable naming. As variable is case-sensitive in php so you can write the code as,


<html>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('html_errors', true);
$fileHandler = opendir('C:\Documents and Settings');
while (false !== ($file = readdir($fileHandler))) {
$files[] = $file;
}
sort($files);
print_r($files);
closedir($fileHandler);
?>
</body>
</html>

Related Documents
Working with cookie in php(set, retrieve, delete)
Accessing data from html forms in php
Track error messages on php
Array declaration, assignment and printing in php
Variables in PHP
Magic constants in php

List of directory contents using array in php

Code
<html>
<body>
<?php
$fileHandler = opendir('C:\Documents and Settings');
while (false !== ($file = readdir($fileHandler))) {
$files[] = $file;
}
sort($files);
print_r($files);
closedir($fileHandler);
?>
</body>
</html>


Output

Array ( [0] => . [1] => .. [2] => A [3] => Administrator [4] => All Users [5] => Default User [6] => LocalService [7] => NetworkService [8] => apache2triad )

Related Documents
Working with cookie in php(set, retrieve, delete)
Accessing data from html forms in php
Track error messages on php
Array declaration, assignment and printing in php
Variables in PHP
Magic constants in php

Monday, March 16, 2009

Array declaration, assignment and printing in php

The term array comes in order to store multiple values in a single variable. In php with help of Array you can store multiple values in a single variable instead of defines multiple variables.
Each element in the array is accessed by the associated key value. A key may be either an integer or a string. By default if no key value is mentioned then it starts with 0.

Array declaration Syntax:
An array is created by the array()language construct.
Like,
$arrayName=array('Arju', 'Momin', 'Robert', 'Davis');

Here array key value is omitted. If array key value is omitted then first element is accessed by $variable_name[interger_key_value_start_from_0]
In this case $arrayName[0] have value Arju.
$arrayName[1] have the value Momin and so on.

Example 01:
The following is the php code,

<html>
<body>
<?php
$arrayName= array("Arju","Momin","Robert","Davis");
echo "This is first element :" . $arrayName[0];
echo "<br />";
echo "This is second element :" . $arrayName[1];
?>
</body>
</html>

Output
This is first element :Arju
This is second element :Momin

Example 02:
Below is an example where key value is assigned manually.
If a key is not specified for a value, the maximum of the integer indices is taken and the new key will be that value plus 1.

<html>
<body>
<?php
$arrayName["students"]= 48;
$arrayName[10]=100;
$arrayName[]=120; //120 assigned to key value 11 as maximum key is 10, so it is 10+1
echo "Total Students :" . $arrayName["students"];
echo "<br />";
echo "10th positioned student mark :" . $arrayName[10];
echo "<br />";
echo "11th positioned student mark :" . $arrayName[11];
?>
</body>
</html>

Output

Total Students :48
10th positioned student mark :100
11th positioned student mark :120


Example 03:

You can define multidimensional array by declaring array within an array.
Following is an example.

<html>
<body>
<?php
$student=Array
(
"Seven" => Array
(1 => 76 ,2 => 65 , 3 => 45 ),
"Eight" => Array
(10 => 87 , 89 ),
"Nine" => Array
( 23 => 98, 25 => 86 , 27 => 56 )
) ;

echo "Result of Roll number of 11 of class Eight is: " .$student['Eight'][11];
echo "<br />";
echo "Result of Roll number of 127 of class Nine is: " .$student['Nine'][27];
?>
</body>
</html>


Output
Result of Roll number of 11 of class Eight is: 89
Result of Roll number of 127 of class Nine is: 56

Modifying Array Values
In order to set an array just issue,
$arrayName[key_value]=new_value;
If the variable does not exist array will be created. So it is an another way to create array.

In order to remove element from the array issue,
unset ($arrayName[key_value]);

In order to the array itself issue,
unset $arrayname;

Example:
<?php
$arr = array(1,5);
$arr[] = 8; // This is the same as $arr[2] = 8;
print_r($arr);
$arr["x"] = 42; // Adds a new element to array.
unset($arr[1]); // Removes 2nd element from the array that is 5.
print_r($arr);
unset($arr); // Deletes whole element of the array
print_r($arr);
?>

In order to delete array element one by one issue,

foreach ($arr as $i => $value) {
unset($arr[$i]);
}

Related Documents
Working with cookie in php(set, retrieve, delete)
Accessing data from html forms in php
Track error messages on php
Variables in PHP
Magic constants in php

Integer and floating point number in Php

Integers in php can be declared as decimal, octal or hexadecimal.
To declare an octal precede the number with zero. (0)
To declare an hexadecimal precede the number with 0x.

The following is the declaration of integer types.


The Integer size can be determined using the constant PHP_INT_SIZE.
The maximum size of the Integer can be determined using the constant PHP_INT_MAX.

The maximum value of Integer is platform dependent.

If Php encounters a value that is beyond integer type then it treats the value as float.

Some declaration of floating point numbers are,

Related Documents
Datatypes in Php
Variables in PHP
Magic constants in php
Boolean datatype in Php

Boolean datatype in Php

The boolean datatype in php in considered specially. The boolean datatype expresses the truth value which can be either TRUE or FALSE.

Confusion may come while your print boolean datatype and while converting the value of boolean datatype variable.

When converting to boolean type the following values are considered as FALSE.

1)the boolean FALSE itself
2)the integer 0 (zero)
3)the float 0.0 (zero)
4)the empty string, and the string "0"
5)an array with zero elements
6)an object with zero member variables (PHP 4 only)
7)the special type NULL (including unset variables)
8)SimpleXML objects created from empty tags

Except the above 8 types all converted boolean type are considered as TRUE even a -1.

Whenever you print any boolean FALSE value it will print NULL and whenever you print any boolean TRUE value it will print 1 but never think that FALSE is NULL and 1 is a constant for TRUE. NULL is boolean value that indicates FALSE and 1 is a boolean value that indicates TRUE.

Symbolic constants are specifically designed to always and only reference their constant value. But booleans are not symbolic constants, they are values which means either true or false. So operate them like symbolic constants may have problems. Like (true+true) will print 2 but two boolean variable containing truth value TRUE adding will print 1.


<html>
<body>
<?php
$booleanTType=True;
$booleanFType=False;
echo 'Output of "(True)":'.$booleanTType ;
echo "<br />";
echo 'Output of "(False)":'. $booleanFType ;
echo "<br />";
echo (true+true);
echo "<br />";
echo 'Output of "(True+True)":'.($booleanTType+$booleanTTypes);
echo "<br />";
echo 'Output of "(False+False)":'.($booleanFType+$booleanFTypes) ;
?>
</body>
</html>

Output
Output of "(True)":1
Output of "(False)":
2
Output of "(True+True)":1
Output of "(False+False)":0
Related Documents
Datatypes in Php
Integer and floating point number in Php
Variables in PHP
Magic constants in php

Datatypes in Php

In Php you don't need to declare datatype of the variable. Based on the variable assignment value php automatically converts it to corresponding datatype. In php there is eight different datatypes.

A)Four Scalar Types:
1)Integer
2)Float/Double
3)String
4)Boolean

B)Two compound Types:
1)Array
2)Object

C)Two special types:
1)Resource
2)Null

The type of variable is decided at runtime by PHP depending on the context in which that variable is used.

  • With var_dump() function you can check the type and value of an expression.

  • With the gettype() function you can also get the type of the variable.

  • With is_{type}() function you can check a certain type. The {type} within brace means that type should be replaced by any data type.
For Integer type checking the function is is_int()
For String type checking the function is is_string()


  • To convert a variable from one type to another either use cast or use the settype() function.
To convert to integer type use the (int) or (integer) casts
To convert to boolean type use the (bool) or (boolean) casts.
To convert to string type use the (string) cast or the strval() function. Though string conversion is done automatically.
A boolean TRUE value is converted to the string "1" and boolean FALSE is converted to "" (the empty string) and vice-versa.

Below is an example:

<html>
<body>
<?php
$btype=FALSE;
$itype=10;
$ftype=100.1;
$stype="This is a String datatype.";
echo gettype($btype);
echo " ". (boolean)($btype); //Note that the display behaviour of boolean type is
either null or 1.
echo "<br />";
echo gettype($itype);
echo " ".$itype;
echo "<br />";
echo gettype($ftype);
echo " ".$ftype;
echo "<br />";
echo gettype($stype);
echo " ". $stype;
echo "<br />";
?>
</body>
</html>

And the output is,

boolean
integer 10
double 100.1
string This is a String datatype.

Note that boolean TRUE or FALSE is treated differently in Php. If you display boolean FALSE expression, NULL will be printed and if you display boolean TRUE expression, 1 will be printed.

Related Documents
Integer and floating point number in Php
Variables in PHP
Magic constants in php
Boolean datatype in Php

Oracle datatype internal code representation

As it is shown in How can one dump/ examine the exact content of a database column? every datatype in oracle has its internal code. In this example every oracle datatype along with their corresponding internal code is shown.

Datatype                                                                      Code
-------------------------------------- -------
1. VARCHAR2(size [BYTE | CHAR]) 01
2. NVARCHAR2(size) 01
3. NUMBER[(precision [, scale]]) 02
4. LONG 08
5. DATE 12
6. BINARY_FLOAT 21
7. BINARY_DOUBLE 22
8. RAW(size) 23
9. LONG RAW 24
10.ROWID 69
11.CHAR [(size [BYTE | CHAR])] 96
12.NCHAR[(size)] 96
13.CLOB 112
14.NCLOB 112
15.BLOB 113
16.BFILE 114
17.TIMESTAMP [(fractional_seconds)] 180
18.TIMESTAMP [(fractional_seconds)] WITH TIME ZONE 181
19.INTERVAL YEAR [(year_precision)] TO MONTH 182
20.INTERVAL DAY [(day_precision)] TO SECOND [(fractional_seconds)] 183
21.UROWID [(size)] 208
22.TIMESTAMP [(fractional_seconds)] WITH LOCAL TIME ZONE 231

Related Documents
http://arjudba.blogspot.com/2009/12/oracle-object-type-exercises-varray.html
http://arjudba.blogspot.com/2009/12/practice-oracle-joins-examples.html
http://arjudba.blogspot.com/2009/12/oracle-security-practices.html
http://arjudba.blogspot.com/2009/12/exercises-with-oracle-create-table-add.html
http://arjudba.blogspot.com/2009/12/oracle-database-creation-exercises.html
http://arjudba.blogspot.com/2009/12/basic-oracle-sql-exercise.html
http://arjudba.blogspot.com/2009/08/format-model-modifiers-fx-and-fm.html
http://arjudba.blogspot.com/2009/08/number-format-models-in-oracle.html
http://arjudba.blogspot.com/2009/08/format-models-in-oracle.html
http://arjudba.blogspot.com/2009/07/sql-decode.html
http://arjudba.blogspot.com/2009/07/how-to-know-row-of-table-belong-to.html
http://arjudba.blogspot.com/2009/06/how-to-know-which-objects-are-being.html
http://arjudba.blogspot.com/2009/06/ddl-with-wait-option-in-11g.html
http://arjudba.blogspot.com/2009/06/ora-00939-too-many-arguments-when-case.html
http://arjudba.blogspot.com/2009/03/oracle-datatype-internal-code.html
http://arjudba.blogspot.com/2009/03/how-to-know-list-of-constraints-and.html
http://arjudba.blogspot.com/2009/02/how-to-know-dependent-objectswhich.html
http://arjudba.blogspot.com/2009/02/how-to-search-stringkey-value-from.html
http://arjudba.blogspot.com/2009/02/how-to-know-when-tableobjects-ddlcode.html
http://arjudba.blogspot.com/2009/02/ora-00920-invalid-relational-operator.html
http://arjudba.blogspot.com/2009/01/adding-default-value-to-column-on-table.html
http://arjudba.blogspot.com/2009/01/ora-12838-cannot-readmodify-object.html
http://arjudba.blogspot.com/2009/01/ora-01779-cannot-modify-column-which.html
http://arjudba.blogspot.com/2009/01/updating-table-based-on-another-table.html
http://arjudba.blogspot.com/2009/01/ora-00054-resource-busy-and-acquire.html
http://arjudba.blogspot.com/2008/12/troubleshoot-ora-02292-ora-02449-and.html

Sunday, March 15, 2009

Variables in PHP

In any programming language variables are the declaration which stands for value. In PHP, variables can be declared to store numbers, characters or any values. Variables can be used as many as you wish inside the script.

  • In PHP all variables must start with $ sign. But we don't need to declare the data type of the variables. PHP automatically converts the variable to the correct data type, depending on how they are set. That's why PHP is called loosely typed language.
  • The variable name in PHP is case-sensitive.
  • A variable name must start with a letter or an underscore "_"
  • A variable name can only contain alpha-numeric characters and underscores (a-z, A-Z, 0-9, _ and the bytes from 127 through 255 (0x7f-0xff). )
  • It should not contain spaces.
  • $this is a special variable that can't be assigned. By default, variables are always assigned by value. Note that PHP offers assignment of values to the variable by two ways, 1) Assign by expression. 2) Assign by reference (simply prepend an ampersand (&) to the beginning of the variable which is being assigned).

Following is an example of PHP variables using and displaying the value of the variables.

<html>
<body>
<?php
$variable1='This is string type variable';
$_variable2=100;
echo $variable1 . "<br />";
echo $_variable2. "<br />";

$variable3=&$_variable2;
$variable4=$_variable2;
echo "Variable3 value:" . $variable3 . "<br />";
echo "variable4 value:" . $variable4. "<br />";
$_variable2=200;
echo "After assignment to _variable2 Variable3 value:" . $variable3. "<br />";
echo "After assignment to _variable2 variable4 value:" . $variable4;
?>
</body>
</html>

The following is the output.

This is string type variable
100
Variable3 value:100
variable4 value:100
After assignment to _variable2 Variable3 value:200
After assignment to _variable2 variable4 value:100

Note that, in the case of "assign by reference" the value of the variable is change if reference value is changed but in case of "assign by expression" if source changes has no effect on assigned variable.

Related Documents
Datatypes in Php
Integer and floating point number in Php
Magic constants in php
Boolean datatype in Php

Saturday, March 14, 2009

Basic PHP Syntax

  • The word PHP stands for HyPertext Preprocessor. PHP is an open source software and free to use. This is a server side scripting language which means codes written in php are executed on server side.
  • All PHP code block starts with <?php and ends with ?>. You can also use <script language="php"> </script>
  • If shorthand support is enabled on the server then you can start a PHP scripting block with <? and end with ?>. Short tag are enabled via the short_open_tag php.ini configuration file directive, or if php was configured with the --enable-short-tags option.
  • Each code line in PHP must end with a semicolon (;). Semicolon differentiates between two instructions.
  • In PHP, with echo or print command you can show output text.A php file can contain html tags just like a normal html file.
  • Note that the closing tag of a PHP block at the end of a file is optional.
  • Two types of commenting code in php script is available. For single line comment use "//". To comment a large block write code inside /* and */

Below is an example of welcome.php.

<html>
<body>
<?php
echo "Welcome to the PHP World";?>
<br> </br>
</body>
</html>
<?php
echo "Welcome from the site http://arjudba.blogspot.com";
?>

Save welcome.php inside htdocs folder (If you use apache web server) and run it from browser. The following will be output.

Welcome to the PHP World

Welcome from the site http://arjudba.blogspot.com
Related Documents
Datatypes in Php
Integer and floating point number in Php
Variables in PHP
Magic constants in php
Boolean datatype in Php

Wednesday, March 11, 2009

Difference between WE8MSWIN1252 and WE8ISO8859P15 characterset

The lists of characters along with their code points used in oracle database character set WE8ISO8859P15 is defined in the http://msdn.microsoft.com/en-us/goglobal/cc305176.aspx.

Also, the lists of characters along with their code points used in oracle database character set WE8MSWIN1252 is defined in the http://msdn.microsoft.com/en-us/goglobal/cc305145.aspx.

If we look for WE8MSWIN1252 and WE8ISO8859P15 character set then 28 code points are not existed in WE8ISO8859P15 but they are used/filled in WE8MSWIN1252.

Also all of the characters exist in WE8ISO8859P15 are also exists in WE8MSWIN1252. So we can say WE8MSWIN1252 is a logical superset of character set WE8ISO8859P15 but not a binary superset.

Also we see 8 codepoints have a different symbol in WE8MSWIN1252 than in P15 for the same physical codepoint.

Below is the lists of all characters under both character sets along with their code points.


Dec. Unico. Charac. WE8ISO8859P15 Character Description
---- ------ ------- (States if different) -----------

0x00 0x0000 [ ] [ ] NULL
0x01 0x0001 [ ] [ ] START OF HEADING
0x02 0x0002 [ ] [ ] START OF TEXT
0x03 0x0003 [ ] [ ] END OF TEXT
0x04 0x0004 [ ] [ ] END OF TRANSMISSION
0x05 0x0005 [ ] [ ] ENQUIRY
0x06 0x0006 [ ] [ ] ACKNOWLEDGE
0x07 0x0007 [ ] [ ] BELL
0x08 0x0008 [ ] [ ] BACKSPACE
0x09 0x0009 [ ] [ ] HORIZONTAL TABULATION
0x0A 0x000A [ ] [ ] LINE FEED
0x0B 0x000B [ ] [ ] VERTICAL TABULATION
0x0C 0x000C [ ] [ ] FORM FEED
0x0D 0x000D [ ] [ ] CARRIAGE RETURN
0x0E 0x000E [ ] [ ] SHIFT OUT
0x0F 0x000F [ ] [ ] SHIFT IN
0x10 0x0010 [ ] [ ] DATA LINK ESCAPE
0x11 0x0011 [ ] [ ] DEVICE CONTROL ONE
0x12 0x0012 [ ] [ ] DEVICE CONTROL TWO
0x13 0x0013 [ ] [ ] DEVICE CONTROL THREE
0x14 0x0014 [ ] [ ] DEVICE CONTROL FOUR
0x15 0x0015 [ ] [ ] NEGATIVE ACKNOWLEDGE
0x16 0x0016 [ ] [ ] SYNCHRONOUS IDLE
0x17 0x0017 [ ] [ ] END OF TRANSMISSION BLOCK
0x18 0x0018 [ ] [ ] CANCEL
0x19 0x0019 [ ] [ ] END OF MEDIUM
0x1A 0x001A [ ] [ ] SUBSTITUTE
0x1B 0x001B [ ] [ ] ESCAPE
0x1C 0x001C [ ] [ ] FILE SEPARATOR
0x1D 0x001D [ ] [ ] GROUP SEPARATOR
0x1E 0x001E [ ] [ ] RECORD SEPARATOR
0x1F 0x001F [ ] [ ] UNIT SEPARATOR
0x20 0x0020 [ ] [ ] SPACE
0x21 0x0021 [!] [!] EXCLAMATION MARK
0x22 0x0022 ["] ["] QUOTATION MARK
0x23 0x0023 [#] [#] NUMBER SIGN
0x24 0x0024 [$] [$] DOLLAR SIGN
0x25 0x0025 [%] [%] PERCENT SIGN
0x26 0x0026 [&] [&] AMPERSAND
0x27 0x0027 ['] ['] APOSTROPHE
0x28 0x0028 [(] [(] LEFT PARENTHESIS
0x29 0x0029 [)] [)] RIGHT PARENTHESIS
0x2A 0x002A [*] [*] ASTERISK
0x2B 0x002B [+] [+] PLUS SIGN
0x2C 0x002C [,] [,] COMMA
0x2D 0x002D [-] [-] HYPHEN-MINUS
0x2E 0x002E [.] [.] FULL STOP
0x2F 0x002F [/] [/] SOLIDUS
0x30 0x0030 [0] [0] DIGIT ZERO
0x31 0x0031 [1] [1] DIGIT ONE
0x32 0x0032 [2] [2] DIGIT TWO
0x33 0x0033 [3] [3] DIGIT THREE
0x34 0x0034 [4] [4] DIGIT FOUR
0x35 0x0035 [5] [5] DIGIT FIVE
0x36 0x0036 [6] [6] DIGIT SIX
0x37 0x0037 [7] [7] DIGIT SEVEN
0x38 0x0038 [8] [8] DIGIT EIGHT
0x39 0x0039 [9] [9] DIGIT NINE
0x3A 0x003A [:] [:] COLON
0x3B 0x003B [;] [;] SEMICOLON
0x3C 0x003C [<] [<] LESS-THAN SIGN 0x3D 0x003D [=] [=] EQUALS SIGN 0x3E 0x003E [>] [>] GREATER-THAN SIGN
0x3F 0x003F [?] [?] QUESTION MARK
0x40 0x0040 [@] [@] COMMERCIAL AT
0x41 0x0041 [A] [A] LATIN CAPITAL LETTER A
0x42 0x0042 [B] [B] LATIN CAPITAL LETTER B
0x43 0x0043 [C] [C] LATIN CAPITAL LETTER C
0x44 0x0044 [D] [D] LATIN CAPITAL LETTER D
0x45 0x0045 [E] [E] LATIN CAPITAL LETTER E
0x46 0x0046 [F] [F] LATIN CAPITAL LETTER F
0x47 0x0047 [G] [G] LATIN CAPITAL LETTER G
0x48 0x0048 [H] [H] LATIN CAPITAL LETTER H
0x49 0x0049 [I] [I] LATIN CAPITAL LETTER I
0x4A 0x004A [J] [J] LATIN CAPITAL LETTER J
0x4B 0x004B [K] [K] LATIN CAPITAL LETTER K
0x4C 0x004C [L] [L] LATIN CAPITAL LETTER L
0x4D 0x004D [M] [M] LATIN CAPITAL LETTER M
0x4E 0x004E [N] [N] LATIN CAPITAL LETTER N
0x4F 0x004F [O] [O] LATIN CAPITAL LETTER O
0x50 0x0050 [P] [P] LATIN CAPITAL LETTER P
0x51 0x0051 [Q] [Q] LATIN CAPITAL LETTER Q
0x52 0x0052 [R] [R] LATIN CAPITAL LETTER R
0x53 0x0053 [S] [S] LATIN CAPITAL LETTER S
0x54 0x0054 [T] [T] LATIN CAPITAL LETTER T
0x55 0x0055 [U] [U] LATIN CAPITAL LETTER U
0x56 0x0056 [V] [V] LATIN CAPITAL LETTER V
0x57 0x0057 [W] [W] LATIN CAPITAL LETTER W
0x58 0x0058 [X] [X] LATIN CAPITAL LETTER X
0x59 0x0059 [Y] [Y] LATIN CAPITAL LETTER Y
0x5A 0x005A [Z] [Z] LATIN CAPITAL LETTER Z
0x5B 0x005B [[] [[] LEFT SQUARE BRACKET
0x5C 0x005C [\] [\] REVERSE SOLIDUS
0x5D 0x005D []] []] RIGHT SQUARE BRACKET
0x5E 0x005E [^] [^] CIRCUMFLEX ACCENT
0x5F 0x005F [_] [_] LOW LINE
0x60 0x0060 [`] [`] GRAVE ACCENT
0x61 0x0061 [a] [a] LATIN SMALL LETTER A
0x62 0x0062 [b] [b] LATIN SMALL LETTER B
0x63 0x0063 [c] [c] LATIN SMALL LETTER C
0x64 0x0064 [d] [d] LATIN SMALL LETTER D
0x65 0x0065 [e] [e] LATIN SMALL LETTER E
0x66 0x0066 [f] [f] LATIN SMALL LETTER F
0x67 0x0067 [g] [g] LATIN SMALL LETTER G
0x68 0x0068 [h] [h] LATIN SMALL LETTER H
0x69 0x0069 [i] [i] LATIN SMALL LETTER I
0x6A 0x006A [j] [j] LATIN SMALL LETTER J
0x6B 0x006B [k] [k] LATIN SMALL LETTER K
0x6C 0x006C [l] [l] LATIN SMALL LETTER L
0x6D 0x006D [m] [m] LATIN SMALL LETTER M
0x6E 0x006E [n] [n] LATIN SMALL LETTER N
0x6F 0x006F [o] [o] LATIN SMALL LETTER O
0x70 0x0070 [p] [p] LATIN SMALL LETTER P
0x71 0x0071 [q] [q] LATIN SMALL LETTER Q
0x72 0x0072 [r] [r] LATIN SMALL LETTER R
0x73 0x0073 [s] [s] LATIN SMALL LETTER S
0x74 0x0074 [t] [t] LATIN SMALL LETTER T
0x75 0x0075 [u] [u] LATIN SMALL LETTER U
0x76 0x0076 [v] [v] LATIN SMALL LETTER V
0x77 0x0077 [w] [w] LATIN SMALL LETTER W
0x78 0x0078 [x] [x] LATIN SMALL LETTER X
0x79 0x0079 [y] [y] LATIN SMALL LETTER Y
0x7A 0x007A [z] [z] LATIN SMALL LETTER Z
0x7B 0x007B [{] [{] LEFT CURLY BRACKET
0x7C 0x007C [|] [|] VERTICAL LINE
0x7D 0x007D [}] [}] RIGHT CURLY BRACKET
0x7E 0x007E [~] [~] TILDE
0x7F 0x007F [ ] [ ] DELETE
0x80 0x20AC [€] [€] UNDEFINED EURO SIGN
0x81 [ ] [ ] UNDEFINED UNDEFINED
0x82 0x201A [‚] [‚] UNDEFINED SINGLE LOW-9 QUOTATION MARK
0x83 0x0192 [ƒ] [ƒ] UNDEFINED LATIN SMALL LETTER F WITH HOOK
0x84 0x201E [„] [„] UNDEFINED DOUBLE LOW-9 QUOTATION MARK
0x85 0x2026 […] […] UNDEFINED HORIZONTAL ELLIPSIS
0x86 0x2020 [†] [†] UNDEFINED DAGGER
0x87 0x2021 [‡] [‡] UNDEFINED DOUBLE DAGGER
0x88 0x02C6 [ˆ] [ˆ] UNDEFINED MODIFIER LETTER CIRCUMFLEX ACCENT
0x89 0x2030 [‰] [‰] UNDEFINED PER MILLE SIGN
0x8A 0x0160 [Š] [Š] UNDEFINED LATIN CAPITAL LETTER S WITH CARON
0x8B 0x2039 [‹] [‹] UNDEFINED SINGLE LEFT-POINTING ANGLE QUOTATION MARK
0x8C 0x0152 [Œ] [Œ] UNDEFINED LATIN CAPITAL LIGATURE OE
0x8D [ ] [ ] UNDEFINED UNDEFINED
0x8E 0x017D [Ž] [Ž] UNDEFINED LATIN CAPITAL LETTER Z WITH CARON
0x8F [ ] [ ] UNDEFINED UNDEFINED
0x90 [ ] [ ] UNDEFINED UNDEFINED
0x91 0x2018 [‘] [‘] UNDEFINED LEFT SINGLE QUOTATION MARK
0x92 0x2019 [’] [’] UNDEFINED RIGHT SINGLE QUOTATION MARK
0x93 0x201C [“] [“] UNDEFINED LEFT DOUBLE QUOTATION MARK
0x94 0x201D [”] [”] UNDEFINED RIGHT DOUBLE QUOTATION MARK
0x95 0x2022 [•] [•] UNDEFINED BULLET
0x96 0x2013 [–] [–] UNDEFINED EN DASH
0x97 0x2014 [—] [—] UNDEFINED EM DASH
0x98 0x02DC [˜] [˜] UNDEFINED SMALL TILDE
0x99 0x2122 [™] [™] UNDEFINED TRADE MARK SIGN
0x9A 0x0161 [š] [š] UNDEFINED LATIN SMALL LETTER S WITH CARON
0x9B 0x203A [›] [›] UNDEFINED SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
0x9C 0x0153 [œ] [œ] UNDEFINED LATIN SMALL LIGATURE OE
0x9D [ ] [ ] UNDEFINED UNDEFINED
0x9E 0x017E [ž] [ž] UNDEFINED LATIN SMALL LETTER Z WITH CARON
0x9F 0x0178 [Ÿ] [Ÿ] UNDEFINED LATIN CAPITAL LETTER Y WITH DIAERESIS
0xA0 0x00A0 [ ] [ ] NO-BREAK SPACE
0xA1 0x00A1 [¡] [¡] INVERTED EXCLAMATION MARK
0xA2 0x00A2 [¢] [¢] CENT SIGN
0xA3 0x00A3 [£] [£] POUND SIGN
0xA4 0x00A4 [¤] [¤] Euro Sign(€) MS1252 code point 80 CURRENCY SIGN
0xA5 0x00A5 [¥] [¥] YEN SIGN
0xA6 0x00A6 [¦] [¦] LATIN CAPITAL LETTER S WITH CARON(Š) 8A BROKEN BAR
0xA7 0x00A7 [§] [§] SECTION SIGN
0xA8 0x00A8 [¨] [¨] LATIN SMALL LETTER S WITH CARON(š) 9A DIAERESIS
0xA9 0x00A9 [©] [©] COPYRIGHT SIGN
0xAA 0x00AA [ª] [ª] FEMININE ORDINAL INDICATOR
0xAB 0x00AB [«] [«] LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
0xAC 0x00AC [¬] [¬] NOT SIGN
0xAD 0x00AD [ ] [ ] SOFT HYPHEN
0xAE 0x00AE [®] [®] REGISTERED SIGN
0xAF 0x00AF [¯] [¯] MACRON
0xB0 0x00B0 [°] [°] DEGREE SIGN
0xB1 0x00B1 [±] [±] PLUS-MINUS SIGN
0xB2 0x00B2 [²] [²] SUPERSCRIPT TWO
0xB3 0x00B3 [³] [³] SUPERSCRIPT THREE
0xB4 0x00B4 [´] [´] LATIN CAPITAL LETTER Z WITH CARON(Ž) 8E ACUTE ACCENT
0xB5 0x00B5 [µ] [µ] MICRO SIGN
0xB6 0x00B6 [¶] [¶] PILCROW SIGN
0xB7 0x00B7 [·] [·] MIDDLE DOT
0xB8 0x00B8 [¸] [¸] LATIN SMALL LETTER Z WITH CARON(ž) 9E CEDILLA
0xB9 0x00B9 [¹] [¹] SUPERSCRIPT ONE
0xBA 0x00BA [º] [º] MASCULINE ORDINAL INDICATOR
0xBB 0x00BB [»] [»] RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
0xBC 0x00BC [¼] [¼] LATIN CAPITAL LIGATURE OE(Œ) 8C VULGAR FRACTION ONE QUARTER
0xBD 0x00BD [½] [½] LATIN SMALL LIGATURE OE(œ) 9C VULGAR FRACTION ONE HALF
0xBE 0x00BE [¾] [¾] LATIN CAPITAL LETTER Y WITH DIAERESIS(Ÿ) 9F VULGAR FRACTION THREE QUARTERS
0xBF 0x00BF [¿] [¿] INVERTED QUESTION MARK
0xC0 0x00C0 [À] [À] LATIN CAPITAL LETTER A WITH GRAVE
0xC1 0x00C1 [Á] [Á] LATIN CAPITAL LETTER A WITH ACUTE
0xC2 0x00C2 [Â] [Â] LATIN CAPITAL LETTER A WITH CIRCUMFLEX
0xC3 0x00C3 [Ã] [Ã] LATIN CAPITAL LETTER A WITH TILDE
0xC4 0x00C4 [Ä] [Ä] LATIN CAPITAL LETTER A WITH DIAERESIS
0xC5 0x00C5 [Å] [Å] LATIN CAPITAL LETTER A WITH RING ABOVE
0xC6 0x00C6 [Æ] [Æ] LATIN CAPITAL LETTER AE
0xC7 0x00C7 [Ç] [Ç] LATIN CAPITAL LETTER C WITH CEDILLA
0xC8 0x00C8 [È] [È] LATIN CAPITAL LETTER E WITH GRAVE
0xC9 0x00C9 [É] [É] LATIN CAPITAL LETTER E WITH ACUTE
0xCA 0x00CA [Ê] [Ê] LATIN CAPITAL LETTER E WITH CIRCUMFLEX
0xCB 0x00CB [Ë] [Ë] LATIN CAPITAL LETTER E WITH DIAERESIS
0xCC 0x00CC [Ì] [Ì] LATIN CAPITAL LETTER I WITH GRAVE
0xCD 0x00CD [Í] [Í] LATIN CAPITAL LETTER I WITH ACUTE
0xCE 0x00CE [Î] [Î] LATIN CAPITAL LETTER I WITH CIRCUMFLEX
0xCF 0x00CF [Ï] [Ï] LATIN CAPITAL LETTER I WITH DIAERESIS
0xD0 0x00D0 [Ð] [Ð] LATIN CAPITAL LETTER ETH
0xD1 0x00D1 [Ñ] [Ñ] LATIN CAPITAL LETTER N WITH TILDE
0xD2 0x00D2 [Ò] [Ò] LATIN CAPITAL LETTER O WITH GRAVE
0xD3 0x00D3 [Ó] [Ó] LATIN CAPITAL LETTER O WITH ACUTE
0xD4 0x00D4 [Ô] [Ô] LATIN CAPITAL LETTER O WITH CIRCUMFLEX
0xD5 0x00D5 [Õ] [Õ] LATIN CAPITAL LETTER O WITH TILDE
0xD6 0x00D6 [Ö] [Ö] LATIN CAPITAL LETTER O WITH DIAERESIS
0xD7 0x00D7 [×] [×] MULTIPLICATION SIGN
0xD8 0x00D8 [Ø] [Ø] LATIN CAPITAL LETTER O WITH STROKE
0xD9 0x00D9 [Ù] [Ù] LATIN CAPITAL LETTER U WITH GRAVE
0xDA 0x00DA [Ú] [Ú] LATIN CAPITAL LETTER U WITH ACUTE
0xDB 0x00DB [Û] [Û] LATIN CAPITAL LETTER U WITH CIRCUMFLEX
0xDC 0x00DC [Ü] [Ü] LATIN CAPITAL LETTER U WITH DIAERESIS
0xDD 0x00DD [Ý] [Ý] LATIN CAPITAL LETTER Y WITH ACUTE
0xDE 0x00DE [Þ] [Þ] LATIN CAPITAL LETTER THORN
0xDF 0x00DF [ß] [ß] LATIN SMALL LETTER SHARP S
0xE0 0x00E0 [à] [à] LATIN SMALL LETTER A WITH GRAVE
0xE1 0x00E1 [á] [á] LATIN SMALL LETTER A WITH ACUTE
0xE2 0x00E2 [â] [â] LATIN SMALL LETTER A WITH CIRCUMFLEX
0xE3 0x00E3 [ã] [ã] LATIN SMALL LETTER A WITH TILDE
0xE4 0x00E4 [ä] [ä] LATIN SMALL LETTER A WITH DIAERESIS
0xE5 0x00E5 [å] [å] LATIN SMALL LETTER A WITH RING ABOVE
0xE6 0x00E6 [æ] [æ] LATIN SMALL LETTER AE
0xE7 0x00E7 [ç] [ç] LATIN SMALL LETTER C WITH CEDILLA
0xE8 0x00E8 [è] [è] LATIN SMALL LETTER E WITH GRAVE
0xE9 0x00E9 [é] [é] LATIN SMALL LETTER E WITH ACUTE
0xEA 0x00EA [ê] [ê] LATIN SMALL LETTER E WITH CIRCUMFLEX
0xEB 0x00EB [ë] [ë] LATIN SMALL LETTER E WITH DIAERESIS
0xEC 0x00EC [ì] [ì] LATIN SMALL LETTER I WITH GRAVE
0xED 0x00ED [í] [í] LATIN SMALL LETTER I WITH ACUTE
0xEE 0x00EE [î] [î] LATIN SMALL LETTER I WITH CIRCUMFLEX
0xEF 0x00EF [ï] [ï] LATIN SMALL LETTER I WITH DIAERESIS
0xF0 0x00F0 [ð] [ð] LATIN SMALL LETTER ETH
0xF1 0x00F1 [ñ] [ñ] LATIN SMALL LETTER N WITH TILDE
0xF2 0x00F2 [ò] [ò] LATIN SMALL LETTER O WITH GRAVE
0xF3 0x00F3 [ó] [ó] LATIN SMALL LETTER O WITH ACUTE
0xF4 0x00F4 [ô] [ô] LATIN SMALL LETTER O WITH CIRCUMFLEX
0xF5 0x00F5 [õ] [õ] LATIN SMALL LETTER O WITH TILDE
0xF6 0x00F6 [ö] [ö] LATIN SMALL LETTER O WITH DIAERESIS
0xF7 0x00F7 [÷] [÷] DIVISION SIGN
0xF8 0x00F8 [ø] [ø] LATIN SMALL LETTER O WITH STROKE
0xF9 0x00F9 [ù] [ù] LATIN SMALL LETTER U WITH GRAVE
0xFA 0x00FA [ú] [ú] LATIN SMALL LETTER U WITH ACUTE
0xFB 0x00FB [û] [û] LATIN SMALL LETTER U WITH CIRCUMFLEX
0xFC 0x00FC [ü] [ü] LATIN SMALL LETTER U WITH DIAERESIS
0xFD 0x00FD [ý] [ý] LATIN SMALL LETTER Y WITH ACUTE
0xFE 0x00FE [þ] [þ] LATIN SMALL LETTER THORN
0xFF 0x00FF [ÿ] [ÿ] LATIN SMALL LETTER Y WITH DIAERESIS


Related Documents

http://arjudba.blogspot.com/2009/03/difference-between-we8iso8859p1-and.html
http://arjudba.blogspot.com/2009/03/difference-between-we8iso8859p1-and_11.html