PHP Programing language

How can Counting Variable Parameter
Previous Home Next
<html>
<head>
<title>Variable Parameter Count</title>
</head>
<body>
<h1>Variable Parameter Count</h1>
<?
function some_func($a, $b) {
            for ($i = 0; $i < func_num_args( ); ++$i) {
                    $param = func_get_arg($i);
                    echo "Received parameter $param.\n";
            }
    }

    function some_other_func($a, $b) {
            $param = func_get_args( );
            $param = join(", ", $param);
            echo "Received parameters: $param.\n";
    }

    some_func(1,2,3,4,5,6,7,8);
    some_other_func(1,2,3,4,5,6,7,8);
   print addNums (19, 20, 34, 42, 75);
?>
</body>
</html>

 

Output:

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: