Bifalgorithm post · Computer science one · Calling Functions

How do you call a function in PHP?

How do you call a function in PHP? (Computer science one · Calling Functions) — "40.1.3. Calling Functions The syntax for calling a function is to simply provi…

Ideas in this flowchart

  • Calling functions
  • A function call uses the function name followed by parentheses.
  • The parentheses contain values or variables passed to the function.
  • Literal values can be passed as arguments.
  • Variables can be passed as arguments.
  • Examples of function calls
  • $c = sum($a, $b); produces the value 30 from $a = 10 and $b = 20.
  • $dist = getDistance(0.0, 0.0, 10.0, 20.0); calls a function with literal values.
  • $monthlyPayment = getMonthlyPayment($p, $r, 60); combines variables and a literal value.
Feed/

How do you call a function in PHP?

No cover

Channel

Computer science one

1 page

"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);"

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.