PHP Programing language

How Can accessing function parameters without using the argument list
Previous Home Next
<html>
<head>
<title>accessing function parameters without 
using the argument list  </title>
</head>
<body>
<h1>accessing function parameters without 
using the argument list</h1>
<?php
function mean() {
    $sum = 0;

    $size = func_num_args();

    for ($i = 0; $i < $size; $i++) {
        $sum += func_get_arg($i);
    }

    $average = $sum / $size;

    return $average;
}

$mean = mean(18, 28, 38);
?>
</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: