Returns an associative array comprising a function's argument list in php
- by diEcho
Hello All,
in php func_get_args — Returns an array comprising a function's argument list
it returns numeric index array
is there any function/way in php by which we get associative array i.e. key=value pair
i m explaining with example:
test.php
<?php
function foo() {
include './fga.inc';
}
$x=20;
$y=30;
foo($x, $y);
?>
fga.inc
<?php
$args = func_get_args();
echo "<pre>";
print_r($args);
echo "</pre>";
?>
which should returns
array (
'x'=> 20,
'y' => 30,
)