Problem in a functions part 2 (parameters and arguments)


#1

Here is my code please look at my code to find the Error.






<?php
$name="sabin";
function greetings($name){
echo(""greetings, " . $name . "!".);
}
greetings($name);
?>




#2

Errors are in this line:

echo(""greetings, " . $name . "!".);

First problem - "" this is an empty string, which means that greetings is outside the string.

Second problem - we use . to concatenate strings, this means that there must be a string at the left side and the right side of the dot. Take a look at the last . in this line of code.

Third problem - it should be Greetings, not greetings :smile:

echo("Greetings, " . $name . "!");