<?php
// Declare a function with default argument value
function greet($name = "world") {
echo "Hello, $name!";
}
// Call the function with default argument value
greet();
// Call the function with a different argument value
greet("John");
?>
Hello, world!
Hello, John!
greet
` that takes one parameter `$name
` with a default value of `"world
"`. Inside the function, we use the `echo
` statement to print out a greeting message with the value of `$name
`. If no argument is passed to the function, the default value of `"world
"` will be used.greet
` twice - first without passing any argument (to use the default value), and then with the argument value `"John
"`.