When a string is literal (contains no variable substitutions), the apostrophe or "single quote" should always be used to demarcate the string:
$a = 'Example String';
When a literal string itself contains apostrophes, it is permitted to demarcate
the string with quotation marks or "double quotes". This is especially useful
for SQL statements:
$sql = "SELECT `id`, `name` from `people` "
. "WHERE `name`='Fred' OR `name`='Susan'";
This syntax is preferred over escaping apostrophes as it is much easier to read.
Variable substitution is permitted using either of these forms:
$greeting = "Hello $name, welcome back!";
$greeting = "Hello {$name}, welcome back!";
For consistency, this form is not permitted:
$greeting = "Hello ${name}, welcome back!";
Strings must be concatenated using the "." operator. A space must always be added before and after the "." operator to improve readability:
$company = 'Zend' . ' ' . 'Technologies';
When concatenating strings with the "." operator, it is encouraged to break the statement into multiple lines to improve readability. In these cases, each successive line should be padded with white space such that the "."; operator is aligned under the "=" operator:
$sql = "SELECT `id`, `name` FROM `people` "
. "WHERE `name` = 'Susan' "
. "ORDER BY `name` ASC ";




