The concatenation operator (.) is used to put two string values together.
To concatenate two string variables together, use the concatenation operator:
<?php
$txt1="Hello World!"; $txt2="What a nice day!"; echo $txt1 . " " . $txt2; ?> |
Hello
World! What a nice day!
|
If we look at the code above you see that we used the concatenation operator two times. This is because we had to insert a third string (a space character), to separate the two strings.
No comments:
Post a Comment