Sunday, April 29, 2012

PHP Parameters in Functions Tutorial


Parameters in Functions
Syntax
Function Function_Name([arg1 [, arg2 [, ... argN ]],]){
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.
Example
<?php
function test($sub)
{
echo $sub." Parameter <br />";
}
test("First ");
test("Second ");
?>
Output
First Parameter 
Second Parameter 

No comments:

Post a Comment