Arguments are listed after the function name, inside the parentheses. You can include as many arguments as needed, separating them with commas.
In the following example, the function has one argument ($fname). When the familyName() function is called, we also provide a name (e.g., “Jani”), which is used within the function to output several different first names while maintaining the same last name
function
}
familyName("Jani");
familyName("Hege");
familyName("Stale");
familyName("Kai Jim"); |
The following example features a function with two arguments: ($fname, $year):
function
}
familyName("Hege", familyName("Stale", familyName("Kai Jim",
|