Complete the code to define a function named greet.
<?php function [1]() { echo "Hello!"; } ?>
The function name must be greet to match the definition.
Complete the code to call the function greet.
<?php
greet[1];
?>Functions in PHP are called with parentheses ().
Fix the error in the function definition by completing the code.
<?php function greet[1] { echo "Hello!"; } ?>
Function definitions require parentheses () even if no parameters are used.
Fill both blanks to create a function that takes a name and prints a greeting.
<?php function greet([1]) { echo "Hello, " . [2] . "!"; } ?>
In PHP, function parameters must have a $ before the variable name, and the same variable is used inside the function.
Fill all four blanks to create a function that returns the sum of two numbers.
<?php function add([1], [2]) { return [3] + [4]; } ?>
The function parameters and return statement must use the same variable names with dollar signs.
