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,...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn