I have a little function that has a string parameter. Now I want a variable defined within that function to be known outside of that function where the function is being executed.
function somefunc($hello) {
$hello = "hi";
$bye = "bye";
return $bye;
}
And using that function in another php script.
somefunc("hi");
echo $bye;
The other script in which the function is being used and in which I'm trying to echo out the variable keeps telling me that the variable bye has not been defined. How can I get its value without making it global? The other script has the function included in it properly, so this cant be the problem.
Thanks in advance for any help!!