Parameters in Functions
Syntax
Function Function_Name([arg1 [, arg2 [, ... argN ]],]){
Function_Body
}
Function_Body
}
You can pass arguments to a function.
Parameters helps to pass informations/ arguments into the function.
The arguments can be either numbers or strings.
Output of the function depends on the arguments you give it.
Parameters helps to pass informations/ arguments into the function.
The arguments can be either numbers or strings.
Output of the function depends on the arguments you give it.
Example
<?phpfunction test($sub)
{
echo $sub." Parameter <br />";
}
test("First ");
test("Second ");
?>
Output
First Parameter Second Parameter
No comments:
Post a Comment