views:

30

answers:

2

This is stumping me.. I am writing components / library functions where it would be used for calling a lot of different functions, so I want it to make an array print out each variable to be passed into the function as an argument, like below but I am pretty sure that this isn't proper syntax.. thanks for any advice

$myfunction = function_name;
$myfunction (print_r($my_array));
+4  A: 

You can use a built-in php function, reference from http://php.net/manual/en/function.call-user-func-array.php

Bang Dao
ok thanks, I will check that out
Rick
A: 

In addition to Bang Dao's answer:

If you need to get all function arguments as array, use func_get_args().

FractalizeR
thank for information.
Bang Dao