code-
<?php
function parentFunction($name='name') {
echo "There are total: ".func_num_args()." Arguments passed.<BR>";
$args = func_get_args();
echo '<pre>';
print_r($args);
echo '</pre>';
//fetch the value
for($i = 0; $i < count($args); $i++) {
echo "Passed Value: {$args[$i]}<br />";
}
}
parentFunction($name= 'name','email','phone','location');
?>
<?php
function parentFunction($name='name') {
echo "There are total: ".func_num_args()." Arguments passed.<BR>";
$args = func_get_args();
echo '<pre>';
print_r($args);
echo '</pre>';
//fetch the value
for($i = 0; $i < count($args); $i++) {
echo "Passed Value: {$args[$i]}<br />";
}
}
parentFunction($name= 'name','email','phone','location');
?>