I’m trying to create a simple function in PHP to greet a user by name, but I keep getting an “undefined variable” error. Here’s the code I’m using:
<?php
function greet_user($name) {
return "Hello, " . $username . "!";
}
echo greet_user("Alice");
?>