Home >php教程 >php手册 >当我运行下面的脚本,它会输出错误信息,我该怎么

当我运行下面的脚本,它会输出错误信息,我该怎么

WBOY
WBOYOriginal
2016-06-13 09:54:12850browse

function myfunc($argument) {
echo $argument + 10;
}
$variable = 10;
echo "myfunc($variable) = " . myfunc($variable);
到底是什么原因呢?
要将自定义函数的结果传回,你需要使用return来将结果传回,而不是echo函数。

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