Home > Backend Development > PHP Tutorial > 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
Release: 2016-07-13 10:53:22
Original
737 people have browsed it

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,...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template