我正在考虑访问所有传递给函数的变量并将它们合并到一个数组中的可能性。 (无传递变量成阵列从一开始)PHP:收集所有作为数组传递给函数的变量?
伪代码:
// Call function
newFunction('one', 'two', 'three') ;// All values are interpreted as a one rray in some way
// Function layout
newFunction() {
// $functionvariables = array(All passed variables)
foreach ($functionvariable as $k => $v) {
// Do stuff
}
}
不能相信这是多么容易。非常感谢,因为我已经得到了这个最快的答案之一:) – Industrial 2010-06-01 22:18:31
我在一个正确的时间在一个正确的地方:D – Andy 2010-06-02 09:46:11