Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Combining data in a string is called concatenation. Besides using double quotes to add another variable into a string, PHP string concatenation also provides two string operators.
Concatenation
There are two string operators. The first is the concatenation operator ('.'), which returns the concatenation of its right and left arguments. The second is the concatenating assignment operator ('.='), which appends the argument on the right side to the argument on the left side. Please read Assignment Operators for more information.
To summarize concatenation. If you want to add a single variable to a string you can include that variable within your double quoted assignment. If you are concatenating a single line you would use a single dot between each string. If you are concatenating multiple lines, you should use the .= assignment operator.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Jennifer Wong
1,622 Points1 Answer
-
Brian Patterson
19,588 Points4 Answers
-
Vjacheslav Rozman
1,895 Points4 Answers
-
Mark Lawson
6,148 Points1 Answer
-
Claudio Vendrame
4,964 Points1 Answer
-
Stephanie Youstra
18,513 Points2 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up