php指定函数参数默认值示例代码
发布时间:2020-12-12 19:59:02 所属栏目:PHP教程 来源:网络整理
导读:例1 代码如下: php函数指定默认值-www.jb51.cc function printMe($param = NULL) { print $param; } printMe("This is test"); printMe(); ?> 输出结果: This is test 例2 php函数参数默认值的使用范例,php函数参数中设置和使用默认值。 代码如下: php函数
例1 代码如下: function printMe($param = NULL) { print $param; } printMe("This is test"); printMe(); ?> 输出结果: 例2 php函数参数默认值的使用范例,php函数参数中设置和使用默认值。 代码如下: function textonweb ($content,$fontsize=3){ echo "$content"; } textonweb ("A ",7); textonweb ("AA. "); textonweb ("AAA. "); textonweb ("AAAA! "); ?> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |