Scope can be defined as the range of availability a variable has to
the program in which it is declared. PHP variables can be one of four
scope types:
But in short a function is a small unit of program which can take some input in the form of parameters and does some processing and may return a some value.
- Local variables
- Function parameters
- Global variables
- Static variables
But in short a function is a small unit of program which can take some input in the form of parameters and does some processing and may return a some value.
Function Parameters
Function parameters are declared after the function name and inside parentheses. They are declared much like a typical variable would be:<?php
// multiply a value by 10 and return it to the caller
function multiply ($value) {
$value = $value * 10;
return $value;
}
$retval = multiply (10);
Print "Return value is $retval\n";
?>
This will produce following result.Return value is 100
0 Comments
Good day precious one, We love you more than anything.