PHP supports expanding (or interpolating) variables inside string literals but not functions.
Any value that's not a function or a variable is known as a literal... it's something that you the programmer gives to the program
like this:
// this is a literal:
"in between the double quotes"
//or numbers
342
Normally, you use an expression to assign these literals to variables. That way, whenever you call the variable name, you get that value back.
like this:
//assign string to variable
$mytext = "hello world";
In above example, hello world is the literal, and mytext is the name of the variable, signfified by the $ sign.
PHP has a feature that inside double quotes, it automagically "expands" or "interpolates" variable names inside string literals.
this lets you do this:
//outputs: mytext: hello world
$mystring = "hello world";
echo "mytext: $mystring";
This is in contrast to other programming languages where you MUST concatenate different types to eachother. In other words, the literal and the variable are considered so different, you must tell the program when you are using one, rather than the other. For instance, in C++:
cout <<< "this is some text: " <<< myvarname <<< endl;
In PHP, the similar way of doing things is:
//outputs: mytest: hellow world
$mystring= "hello world";
echo "mytext is: " . $mystring;
The dot operator (the period ".") concatenates each value to the last one.
It doesn't rely on string interpolation.
Now, when it comes to functions, you are asking PHP to go execute a different bunch of code. So you can't just interpolate functions into strings. You cannot do this:
echo "mytext is myfunction()";
// This outputs: mytext is myfunction()
Instead, you must do this:
function myfunction()
{
// returns the literal (not variable) "hello world"
return "hello world";
}
echo "mytext is " . myfunction() . "more text";
Change you code to reflect the above principle. Look at the part where it is printing the name of the function instead of actually calling it.
Here's the string documentation:
http://us2.php.net/manual/en/language.types.string.php