Home > php教程 > php手册 > 有返回值的函数

有返回值的函数

WBOY
Release: 2016-06-13 10:25:49
Original
1411 people have browsed it



有返回值的函数




function makeBold($inputText)//定义function makeBold()函数
{
$boldedText = "";
$boldedText .= $inputText;
$boldedText .= "
";
return($boldedText);//返回变量$boldedText
}
print("这行没有加重!!!
");//直接打印字符串
print(makeBold("这行被加重了!!!") . "
");//调用function makeBold()函数
print("这行没有加重!!!
");//直接打印字符串
?>



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