function parame...LOGIN

function parameters

PHP functions can have no parameters or several parameters. Multiple parameters are called parameter lists, separated by commas. The parameters are similar to a variable and are used to pass data to the function body when called. By passing parameters, the function can perform operations on the parameters and obtain the results we want.

The variable name of the parameter can be freely specified, but it is best to express the relevant meaning. The commonly used method of setting parameters is:

<?php
function sum($a, $b) { 
   return $a+$b; 
}
?>


Next Section
<?php function sum($a, $b) { return $a-$b; } ?>
submitReset Code
ChapterCourseware