function myfunc($argument) {
echo $argument + 10;
}
$variable = 10;
echo "myfunc($variable) = " . myfunc($variable);
What is the reason?
To pass back the result of a custom function, you need to use return to pass the result back instead of the echo function.
http://www.bkjia.com/PHPjc/632413.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632413.htmlTechArticlefunction myfunc($argument) { echo $argument + 10; } $variable = 10; echo "myfunc($ variable) = " . myfunc($variable); What is the reason? To pass back the result of a custom function,...