Hi there @esu, welcome to the forums 
Before I answer your question I want to first go through some terminology. When programming it is important that everyone uses the same words to mean the same things, otherwise it just becomes confusing for everybody.
So first, as you stated this is a function:
function show($now){
echo $now;
}
A function has a name (show
in this case) and zero or more parameters, which are input for the function to work with.
In the following line, $top
is a variable, not a parameter:
$top = 'im here for you';
The following is a function call, I’m calling a function with the argument hello
:
show('hello');
When I do that, within the show
function, the variable $now
is set to hello
. Outside of the show
method there is no $now
variable. We say that the variable is scoped to the function.
To illustrate, consider the following:
function show($now) {
echo $now;
}
show('hello');
echo $now; // results in "PHP Notice: Undefined variable: now"
As you can see, PHP tells me that the variable $now
doesn’t exist. It exists as long as we’re inside the show
function, then it’s gone again.
The other way around, the function has no access to anything that is defined outside itself:
$now = 'hello';
function show() {
echo $now; // results in "PHP Notice: Undefined variable: now"
}
$now
is defined outside the show
function, so show
has no access to it, PHP will tell you it doesn’t exist.
So in order to give it access we use parameters to pass a variable from outside the function to inside the function:
function show($now) {
echo $now;
}
$top = 'im here for you';
show($top);
so the value of the variable that is $top
outside the show
function is available as the $now
variable inside the show
function. You could say that the value of $top
is copied to the $now
variable within the show
function.
Does that help, or just confuse you more? 