Home > Backend Development > PHP Tutorial > Functions with default parameters_PHP tutorial

Functions with default parameters_PHP tutorial

WBOY
Release: 2016-07-13 17:25:54
Original
799 people have browsed it



Function with default parameters




function printColored($Text, $Color="black")//Define function function
{
print("$Text");//Get the content and color of the string
}
printColored("This is a black word!");//Call function
print("
");
printColored("This is a blue word!", "blue");//Call function
print("
");
?>



www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532022.htmlTechArticleFunction function with default parameters printColored($Text, $Color=black)//Define function { print( $Text );//Get the content and color of the string} printColored(This is a black word!...
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