Complete the code to declare a function named greet.
<?php function [1]() { echo "Hello!"; } ?>
The function name must be greet to match the call later.
Complete the code to call the function greet.
<?php
greet[1];
?>Functions in PHP are called with parentheses () even if they have no parameters.
Fix the error in the function declaration to accept one parameter named name.
<?php function greet([1]) { echo "Hello, $name!"; } ?>
In PHP, function parameters must have a dollar sign $ before the variable name.
Fill both blanks to call the greet function with the argument 'Alice'.
<?php greet([1][2]); ?>
The argument must be a string with quotes. Single quotes or double quotes work, but only one option can be chosen here. The second blank is empty because the quotes include the whole string.
Fill all three blanks to declare a function named add that takes two parameters and returns their sum.
<?php function [1]([2], [3]) { return $a + $b; } ?>
$.add.The function name is add. The parameters must be variables with $ signs: $a and $b.