Home  >  Article  >  Backend Development  >  When I run the following script, it outputs an error message, what should I do_PHP Tutorial

When I run the following script, it outputs an error message, what should I do_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:53:22662browse

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.

www.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