I am trying to do function overloading in PHP and I want to make the return value of a function into a variable. But if I do
<?php
include("functions.php");
func();
echo $add;
?>
in my index.php file and
<?php
function func() {
$add = 1+2;
return $add;
}
?>
in my functions.php file it gives me an undefined variable error. How do I fix this?