ManualePHP
ManualePHP
Input/output:
echo x, y, …;
echo(x,y,…);
print x, y, …;
Conditions:
if(condition){
blocK1
}else{
block2
}
if(condition){
blocK1
}elsif{
block2
}… else {
blockN
}
switch(value) {
case value1: block1;
case value2: block2;
…
default:blockN
}
Loops:
while (condition) {
block;
}
do {
block;
} while (condition);
break;
String functions:
Number functions:
bool is_int(number);
bool is_float(number);
bool is_finite(number);
bool is_infinite(number);
bool is_nan(number);
bool is_numeric(variable);
Math functions:
Arithmetic operators:
+ addition
- subtraction
* multiplication
/ division
% modulus
^ exponentiation
Assignment operators:
= assignment
+= add
-= subtract
*= multiply
/= divide
%= mudulize
Comparison operators:
== equal
=== identical (value and type)
!= not equal
!== not identical
> greater than
>= greater than or equal
< less than
<= less than or equal
Functions:
functionName(parameters); // call
Arrays:
indexed
$variable = array(first, second, …);
$variable = array();
associative
$variable = array(firstkey => firstvalue, secondkey => secondvale, …);
$variable = array();
multidimensional
$variable = array(
array(first, second, …);
array(first, second, …);
array(first, second, …);
…
);
Array functions:
$GLOBALS
$_SERVER
$_REQUEST
$_POST
$_GET
$_FILES
$_ENV
$_COOKIE
$_SESSION
OOP:
__construct(parameters); // constructor
__destruct(); // desctructor