August 2013
Intermediate to advanced
140 pages
1h 49m
English
CHAPTER 4
![]()
String
A string is a series of characters that can be stored in a variable. In PHP, strings are typically delimited by single quotes.
$a = 'Hello';
String concatenation
PHP has two string operators. The dot symbol is known as the concatenation operator (.) and combines two strings into one. It also has an accompanying assignment operator (.=), which appends the right-hand string to the left-hand string variable.
$b = $a . ' World'; // Hello World$a .= ' World'; // Hello World
Delimiting strings
PHP strings can be delimited in four different ways. There are two single-line notations: double-quote (" ") and single-quote (' '). The ...
Read now
Unlock full access