By: Andi, Stig and Derick Emailed: 1728 times Printed: 2329 times
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.
Be the first one to add a comment
Most Viewed Articles (in PHP )
Most Emailed Articles (in PHP)