diff options
Diffstat (limited to 'php.html.markdown')
-rw-r--r-- | php.html.markdown | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/php.html.markdown b/php.html.markdown index 40c9dd01..57ba29c4 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -34,6 +34,7 @@ echo "World\n"; // Prints "World" with a line break ?> Hello World Again! <?php +// That is because historically PHP started as a Template engine /************************************ @@ -41,12 +42,15 @@ Hello World Again! */ // Variables begin with the $ symbol. -// A valid variable name starts with a letter or underscore, +// A valid variable name starts with a letter or an underscore, // followed by any number of letters, numbers, or underscores. +// You don't have to (and cannot) declare variables. +// Once you assign a value, PHP will create the variable with the right type. + // Boolean values are case-insensitive $boolean = true; // or TRUE or True -$boolean = false; // or FALSE or False +$boolean = FALSE; // or false or False // Integers $int1 = 12; // => 12 @@ -289,7 +293,7 @@ if (false) { print (false ? 'Does not get printed' : 'Does'); // ternary shortcut operator since PHP 5.3 -// equivalent of "$x ? $x : 'Does'"" +// equivalent of "$x ? $x : 'Does'" $x = false; print($x ?: 'Does'); |