mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-27 13:32:56 +03:00
Merge pull request #3939 from pendashteh/patch-2
Explains variable declaration plus a minor improvement
This commit is contained in:
commit
efb04d3183
@ -41,12 +41,15 @@ Hello World Again!
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Variables begin with the $ symbol.
|
// 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.
|
// 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 values are case-insensitive
|
||||||
$boolean = true; // or TRUE or True
|
$boolean = true; // or TRUE or True
|
||||||
$boolean = false; // or FALSE or False
|
$boolean = FALSE; // or false or False
|
||||||
|
|
||||||
// Integers
|
// Integers
|
||||||
$int1 = 12; // => 12
|
$int1 = 12; // => 12
|
||||||
|
Loading…
Reference in New Issue
Block a user