I've got an array like this
array('item1', 'item2', 'item3');
Does anybody know how I would pass each item into a function seperately?
EG:
hello_world('item1', 'item2', 'item3');
I've got an array like this
array('item1', 'item2', 'item3');
Does anybody know how I would pass each item into a function seperately?
EG:
hello_world('item1', 'item2', 'item3');
hello_world($array[0], $array[1], $array[2])
or
call_user_func_array('hello_world', $array)
http://www.php.net/manual/en/function.call-user-func-array.php
call_user_func_array('func',$myArgs);
The array_map
function can help you http://www.php.net/manual/es/function.array-map.php