R4R Team working to provide free of cost for experienced and freshers

Tutorials | Examples|Interview Questions and Answers|Java Tutorials| C Tutorials | C++ Tutorials | Spring Tutorials| Hibernate Tutorials | JSP Tutorials | Servelets Tutorials| C# Tutorials | PHP Tutorials etc , Basics | Download Software | Data Types | Variables | Constant | Storage & Classes | Operators | Decisions Making | Loops | Functions| Numbers | Arrays | Pointers | String | Datastructure | Expressions | Preprocessor Statement | I/O | Exception Handling | OOPs Tutorial | Classes and object |C++ Inheritance Overloading | Polymorphism | Abstraction | Encapsulation | Interfaces | Multithreading etc

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