Code: Select all
function hello();Code: Select all
function hello($variable);and (if anything) what does the $variable do between the brackets?
could someone point me to a tutorial or give me a short briefing.
Moderator: General Moderators
Code: Select all
function hello();Code: Select all
function hello($variable);Code: Select all
function hello() {
echo "Hello there!";
}
OR THIS:
function hello($name) {
echo "Hello there $name!"; // print the message with the given name
}Code: Select all
function hello ($name = false) {
if ($name !== false) // this means that a name was given .. hello("name");
echo "How are you doing today $name?";
else // a name was NOT given .. hello();
echo "Hello there!";
}