Home >php教程 >php手册 >有默认参数的函数

有默认参数的函数

WBOY
WBOYOriginal
2016-06-13 10:25:471081browse



有默认参数的函数




function printColored($Text, $Color="black")//定义function函数
{
print("$Text");//获取字符串的内容和颜色
}
printColored("这是黑颜色的字!");//调用function函数
print("
");
printColored("这是蓝颜色的字!", "blue");//调用function函数
print("
");
?>



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