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

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

WBOY
Release: 2016-06-13 09:54:12
Original
857 people have browsed it

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

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template