Base Data Types
Integer 1
Float 1.2
Boolean true, false
String 'Syntax', "Nut"The String data format
Container Types
Array $array = array(1, 2, 3);
Flow Control
if / else / elseif
if (boolean expression) {
    // statements
} elseif (boolean expression) {
    // statements
} else {
    // statements
}
while
while (boolean expression) {
    // statements
}
do while
do {
    // statements
} while (boolean expression);
for loop
for ($x = 0; $x < $size; $x++) {
    // statements
}
foreach
foreach ($array as $value) {
    // statements
}
switch / case / default
switch(var) {
    case varValue1:
        // statements
        break;
    case varValue2:
        // statements
        break;
    default:
        // statements
}
try / catch / finally
try {
    // statements
} catch (Exception $e) {
    // statements
} finally {
    // statements
}
function
function functionName($arg1) {
    // statements
    return $value;
}
Hello World
<?php
    print("Hello world!");
?>
Logical Operators
Comparisons <, <=,>, >=
Equals == Equal value
=== Equal value and type
!=, <> Not equal value
!== Not equal value and type
And and, &&
Or or, ||
Exclusive Or (XOR) xor
Negate !(boolean expression)
Spaceship <=> 0 if equal, 1 if left is greater, -1 if right is greater
Arithmetic Operators
Add +
Subtract -
Multiply *
Divide /
Modulus %
Exponent **