Home >Backend Development >PHP Tutorial >Functions with return values_PHP Tutorial

Functions with return values_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 17:25:56889browse



Function with return value




function makeBold($inputText)//Define function makeBold() function
{
$boldedText = "";
$boldedText .= $inputText;
$boldedText .= "
";
return($boldedText);//Return variable $boldedText
}
print("This line is not emphasized!!!
");//Print the string directly
print(makeBold("This line is emphasized!!!") . "
");//Call function makeBold() function
print("This line is not aggravated!!!
");//Print the string directly
?>



www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532021.htmlTechArticleFunction function with return value makeBold($inputText)//Define function makeBold() function { $boldedText = ; $boldedText .= $inputText; $boldedText .= ; return($boldedText);//Return variable...
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