函数 php定义一个参数带有默认值的函数
php定义一个参数带有默认值的函数 [代码片段(12行)]
<?php
function capitalize( $str, $each=TRUE ) {
$str = strtolower($str);
if ($each === TRUE) { $str = ucwords ($str);
} else {
$str = strtoupper($str); }
echo ("$str <br />");
}
capitalize("hEllo WoRld!");
capitalize("hEllo WoRld!",FALSE);
?>
精彩图集
精彩文章






