源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

php指定函数参数默认值示例代码

  • 时间:2021-02-07 05:17 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:php指定函数参数默认值示例代码
例1
[u]复制代码[/u] 代码如下:
<html> <head> <title>php函数指定默认值-www.1sucai.cn</title> </head> <body> <?php function printMe($param = NULL) {    print $param; } printMe("This is test"); printMe(); ?> </body> </html>
输出结果: This is test 例2 php函数参数默认值的使用范例,php函数参数中设置和使用默认值。
[u]复制代码[/u] 代码如下:
<html>   <head>   <title>php函数参数默认值 - www.1sucai.cn</title>   </head>   <body>   <?php   function textonweb ($content, $fontsize=3){      echo "<font SIZE=$fontsize>$content</font>";   }   textonweb ("A <br />", 7);   textonweb ("AA.<br />");   textonweb ("AAA. <br />");   textonweb ("AAAA! <br />");   ?>   </body>   </html>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部