Concept
How do you call a function in PHP?
ComputerScienceOne / Calling Functions
"40.1.3. Calling Functions The syntax for calling a function is to simply provide the function name followed by parentheses containing values or variables to pass to the function. Some examples: 1 $a = 10, $b = 20; 2 $c = sum($a, $b); //c contains the value 30 3 4 //invoke a function with literal values: 5 $dist = getDistance(0.0, 0.0, 10.0, 20.0); 6 7 //invoke a function with a combination: 8 $p = 1500.0; 9 $r = 0.05; 10 $monthlyPayment = getMonthlyPayment($p, $r, 60);"
Related Ideas
- How do you call a PHP function with values or variables?ComputerScienceOne · Organizing Functions
- How do you declare functions and specify their return values in PHP?ComputerScienceOne · Declaring Functions
- Where and how can functions be defined and used in PHP?ComputerScienceOne · Declaring Functions
- What are the key features of functions in PHP?ComputerScienceOne · Declaring Functions
- How do default parameter values work in PHP functions?ComputerScienceOne · Optional & Default Parameters
- What happens when optional PHP function parameters are omitted?ComputerScienceOne · Optional & Default Parameters
- How does PHP pass arguments by reference?ComputerScienceOne · Passing By Reference
- How can functions be assigned to variables and invoked as callbacks?ComputerScienceOne · Function Pointers