By: Andi, Stig and Derick Viewed: 169 times Printer Friendly Format
Concatenation Operator (.)
The concatenation operator concatenates two strings. This operator works only on strings; thus, any non-string operand is first converted to one.
The following example would print out "The year is 2000":
$year = 2000;
print "The year is " . $year;
The integer $year is internally converted to the string "2000" before it is concatenated with the string’s prefix, "The year is".
Numeric Operators All the binary operators (except for the concatenation operator) work only on numeric operands. If one or both of the operands are strings, Booleans, nulls, or resources, they are automatically converted to their numeric equivalents before the calculation is performed.
|+||Addition||The sum of the two operands.|
The difference between the two operands.
The product of the two operands.
The quotient of the two operands.
Both operands are converted to integers. The result is the remainder of the division of the first operand by the second operand.
Most Viewed Articles (in PHP )
Latest Articles (in PHP)
Comment on this tutorial
- Cloud Computing
- Java Beans
- Mac OS X
- Office 365
- Tech Reviews