php 不定参数的传递

相关函数

  • func_get_args
  • func_num_args
<?php
    function more_args(){
        $args = func_get_args();
        for($i=0;$i<func_num_args();$i++){
            $a = $i +1;
            echo "第".$a."个参数是".$args[$i]."<br>";
        }
    }
    more_args('a','b','c','d','e','f');
?>
posted @ 2019-12-02 17:43  绝技小嗨皮  阅读(475)  评论(0编辑  收藏  举报
Title