首页 > 开发 > PHP > 正文

有返回值的函数

2024-05-04 22:57:38
字体:
来源:转载
供稿:网友
<html>
<head>
<title>有返回值的函数</title>
</head>
<body>
<font size=5>
<?
function makebold($inputtext)//定义function makebold()函数
{
$boldedtext = "<b>";
$boldedtext .= $inputtext;
$boldedtext .= "</b>";
return($boldedtext);//返回变量$boldedtext
}
print("这行没有加重!!!<br>/n");//直接打印字符串
print(makebold("这行被加重了!!!") . "<br>/n");//调用function makebold()函数
print("这行没有加重!!!<br>/n");//直接打印字符串
?>
</size>
</body>
</html>



发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表