May 2016
Intermediate to advanced
155 pages
2h 15m
English
© Mikael Olsson 2016
Mikael Olsson, PHP 7 Quick Scripting Reference, 10.1007/978-1-4842-1922-5_4
Mikael Olsson1
(1)Hammarland, Finland
A string is a series of characters that can be stored in a variable. In PHP, strings are often delimited by single quotes.
$a = 'Hello';PHP has two string operators. The dot symbol is known as the concatenation operator(.). It 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
PHP strings can be delimited in four different ways. There are two common notations: double quote (" ") and single quote (
Read now
Unlock full access