The php function arguments are similar to a variable. You have to define it in the function name to get the output.
Example
[php]<?php
function familyName($fname , $lname) {
echo "$fname $lname.<br>";
}
familyName("Jani", "jget");
familyName("Hege" , "jget");
familyName("Stale" , "jget");
familyName("Kai Jim" , "jget");
familyName("Borge" , "jget");
?>[/php]
In the above code, we have declared a function. The function has function name “familyName
“. The function name has two arguments $fname
and $lname
. On the next line in the curly bracket, we have to ask php script to echo the statement containing the “$fname
” value and “$lname
” value.
After closing the curly bracket we have mentioned the value of the variables in the function statement. Each function name statement has a value of the first name and last name. This information is an echo in the function statement when running in the browser.
You will get the following result from the above script.
Jani jget.
Hege jget.
Stale jget.
Kai Jim jget.
Borge jget.