有返回值的函数_PHP

WBOY
Release: 2016-06-01 12:40:50
Original
980 people have browsed it


有返回值的函数




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


Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!