In PHP, concatination is the joining of strings. The easiest way to explain this process is through the following examples.With concatinatiion, two variables can be joined with a period inserted between them.
Example 1
echo $var1.$var2;
#Ouput is My name isJohn.
Example 2
echo $var1.$var2;
#Ouput is My name is John.
Example 3
echo $var1.” “.$var2;
#Ouput is My name is John.
Notes:
With php, all text between quotes can be ended with a period. In example 3, a space was created after $var1. We simply used quotes to make a space.
Below, is the same as example 3 with the exception of using single quotes.
echo $var1.’ ‘.$var2;
#Ouput is: My name is John.
© 2018 ALL Rights Reserved | Sitemap
Vancouver | North Vancouver | Burnaby | Richmond | Coquitlam | Port Coquitlam | Surrey | Langley | Maple Ridge | Mission | Abbotsford | Kamloops | Kelowna | Victoria | Squamish | Whistler | Pemberton