String Operators

There are two string operators:

<html>
<head>
<title>PHP</title>
<meta Name="Author" Content="Hann So">
</head>
<body>
<p>
<?php
$a = "Hello ";
$b = $a . "World!"; // now $b contains "Hello World!"
echo "The value of variable a is: $a<br />";
echo "The value of variable b is: $b<br /><br />";
$a = "Hello ";
$a .= "World!";    // now $a contains "Hello World!"
echo "The value of variable a is: $a<br />";
echo "The value of variable b is: $b<br />";
?>
</p>
</body>
</html>

View the effect


Operators | Arithmetic | Increment/Decrement | Assignment | Comparison | Logical | Execution | String | Bitwise | Ternary | Operator Precedence
© 2008: Hann So
email: hso@voyager.deanza.edu