1 2 3 4 5 6 7
<?php function foo($bar1, $bar2, $bar3) { print_r($arr = get_defined_vars()); } foo('bartext','bar2text','bar3text'); ?>
1 2 3 4 5 6
Array ( [bar1] => bartext [bar2] => bar2text [bar3] => bar3text )