Showing posts with label Operator. Show all posts
Showing posts with label Operator. Show all posts

Friday, October 1, 2010

The Concatenation Operator in Php

The concatenation operator is a single dot. Treating both operands as strings, it
appends the right-hand operand to the left. So
"hello"." world"
returns
"hello world"
Regardless of the data types of the operands, they are treated as strings, and the
result always is a string.

The Assignment Operator in Php

You have met the assignment operator each time we have initialized a variable. It
consists of the single character =. The assignment operator takes the value of its
right-hand operand and assigns it to its left-hand operand:
$name ="matt";
The variable $name now contains the string "matt". Interestingly, this construct is
an expression. It might look at first glance that the assignment operator simply
changes the variable $name without producing a value, but in fact, a statement that
uses the assignment operator always resolves to a copy of the value of the right
operand. Thus
print ( $name = "matt" );
prints the string "matt" to the browser in addition to assigning "matt" to $name.
Arithmetic Operators