Forum Moderators: coopster
I have a variable which holds a variable number of arguments that I need to pass to a function.
Any ideas how I can do this?
eg...
$other = "hello,gavin,test";
function($other);
Pretty much does function("hello,gavin,test")
I need it to do:
function("hello","gavin","test");
Baring in mind that the number of arguments in the $other variable is likely to change, and isn't a set number.
Any ideas?
Many thanks!
[edited by: GavinTBS at 6:44 pm (utc) on Mar. 15, 2009]
function("hello","gavin","test");
I think IanKelley has probably answered your query in this instance, but it might be worth bearing in mind that in PHP you can have Variable-length argument lists [uk2.php.net] as you are suggesting here.