Arrays

Examples: A simple array The comma after the last array element is optional and can be omitted. This is usually done for single-line arrays, i.e. array(1, 2) is preferred over array(1, 2, ). For multi-line arrays on the other hand the trailing comma is commonly used, as it allows easier addition of new elements at the end. As of PHP 5.4 you can also use the short array syntax, which replaces array() with []. <?php $array = array(     "foo" => "bar",     "bar

Strings

Examples: The simplest way to specify a string is to enclose it in single quotes (the character '). To specify a literal single quote, escape it with a backslash (\). To specify a literal backslash, double it (\\). All other instances of backslash will be treated as a literal backslash: this means that the other escape sequences you might be used to, such as \r or \n, will be output literally as specified rather than having any special meaning. Note: Unlike the do

Floating point numbers

Examples: Floating point numbers (also known as "floats", "doubles", or "real numbers") can be specified using any of the following syntaxes: <?php $a = 1.234;  $b = 1.2e3;  $c = 7E-10; ?> Formally: LNUM [0-9]+ DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) EXPONENT_DNUM [+-]?(({LNUM} | {DNUM}) [eE][+-]? {LNUM}) $a and $b are equal to 5 digits of precision. As noted in the warning above,

Integers

Examples: Integer literals Integers can be specified in decimal (base 10), hexadecimal (base 16), octal (base 8) or binary (base 2) notation, optionally preceded by a sign (- or +). Binary integer literals are available since PHP 5.4.0. To use octal notation, precede the number with a 0 (zero). To use hexadecimal notation precede the number with 0x. To use binary notation precede the number with 0b. <?php $a = 1234; // decimal number $a = -123; // a negative 

Booleans

Examples: To specify a boolean literal, use the constants TRUE or FALSE. Both are case-insensitive. <?php $foo = True; // assign the value TRUE to $foo ?> Typically, the result of an operator which returns a boolean value is passed on to a control structure. <?php // == is an operator which tests // equality and returns a boolean if ($action == "show_version") {     echo "The version is 1.23"; } // this is not necessary... i