I have a function:
myfunc () {
$a = "John";
$str = "Hello $a, how are you today?"
return $str;
}
echo myfunc(); //Hello John, how are you today?
I want to save all the sentenses in that function to another file, because their length is too long to put it in my function.
myfunc () {
$a = "John";
$str = file_get_contents("inc_file.html");
return $str;
}
inc_file.html:
Hello $a, how are you today?
But it didn't return as I expected. The variable $a is not changed to John. Please help me ! Thanks