User-Defined Functions
Give this one a try later!
function name_of_function (parameters) {Statements;}
Passing a Parameter by Value
Give this one a try later!
A local copy of the variable is created to be used by the function. Any
changes made to the variable's value are lost when the function exits.
Arithmetic Operators
,Give this one a try later!
Perform mathematical calculation
Function Definition
Give this one a try later!
Statements within the body of the function.
$result = $interestRate * 12; [Expression]
Give this one a try later!
Variables: $result
Operators: = and *
Operands: $interestRate
Literals: 12
Assignment Operators
Give this one a try later!
Used to assign value to a variable, such as =, *=, etc.
Returning Values
, Give this one a try later!
function averageValues ($first, $second, $third) {
$Sum = $first+$second+$third;
$Result = $Sum/3;
Return $result;
}
echo averageValues(6,4,5);
Variable Identifiers
Give this one a try later!
Must begin with a dollar sign ($), can contain letters, numbers and
underscores; must be space-less, and are case-sensitive
$variable_name = value;
PHP is loosely-typed and follows Dynamic Typing.
Infinite Loop
Give this one a try later!
A loop statement never ends because its conditional expression is never
FALSE.
'while' Statement
Give this one a try later!
Give this one a try later!
function name_of_function (parameters) {Statements;}
Passing a Parameter by Value
Give this one a try later!
A local copy of the variable is created to be used by the function. Any
changes made to the variable's value are lost when the function exits.
Arithmetic Operators
,Give this one a try later!
Perform mathematical calculation
Function Definition
Give this one a try later!
Statements within the body of the function.
$result = $interestRate * 12; [Expression]
Give this one a try later!
Variables: $result
Operators: = and *
Operands: $interestRate
Literals: 12
Assignment Operators
Give this one a try later!
Used to assign value to a variable, such as =, *=, etc.
Returning Values
, Give this one a try later!
function averageValues ($first, $second, $third) {
$Sum = $first+$second+$third;
$Result = $Sum/3;
Return $result;
}
echo averageValues(6,4,5);
Variable Identifiers
Give this one a try later!
Must begin with a dollar sign ($), can contain letters, numbers and
underscores; must be space-less, and are case-sensitive
$variable_name = value;
PHP is loosely-typed and follows Dynamic Typing.
Infinite Loop
Give this one a try later!
A loop statement never ends because its conditional expression is never
FALSE.
'while' Statement
Give this one a try later!