这只是一个例子,但我可以解决这个问题吗?
function echoText($text){
echo $text;
}
$text2 = echoText("Text");
echo "<h1>$text2</h1><br><h2>$text</h2><h3>$text</h3>";
Run Code Online (Sandbox Code Playgroud)
但结果不是<h1>,<h2>或者<h3>,它只是简单的文本.
你的函数没有返回值,而是回显它.
尝试
function echoText($text){
return $text;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1326 次 |
| 最近记录: |