all variables begin with a dollar sign - makes string embedding easy
Line 6:
Line 6:
PHP is an ''interpreted language'' (like Perl) and not a ''compiled'' one (like [[Java]] or [[C]]).
PHP is an ''interpreted language'' (like Perl) and not a ''compiled'' one (like [[Java]] or [[C]]).
+
+
==String handling==
+
+
The [[string concatenation]] operator is the period (or full stop). This is a big difference from most other languages, which use a plus sign or ampersand.
+
+
Example:
+
+
<code>
+
$first = "car";
+
$second = "nation";
+
$product= $first . $second;
+
+
// Equivalent to:
+
$product= "carnation"
+
+
PHP recognizes variable names within strings which are enclosed in double quotes.
+
Since all variables begin with a dollar sign, it is easy to embed one string inside another. This is the preferred way to create HTML output.