how to expand an array elements as separate parameters to a function
You can use the function call_user_func_array.
<?php$colors = array('red','maroon','blue','green');call_user_func_array('setLineColor', $colors);?>
If you want to call the method of an object, you can use this instead:
<?php$graph = new ...$colors = array('red','maroon','blue','green');call_user_func_array(array($graph, 'setLineColor'), $colors);?>