我將用一個簡單的函數接受任何數目的功能轉發不確定數量的參數給另一個函數
function abc() {
$args = func_get_args();
//Now lets use the first parameter in something...... In this case a simple echo
echo $args[0];
//Lets remove this first parameter
unset($args[0]);
//Now I want to send the remaining arguments to different function, in the same way as it received
.. . ...... BUT NO IDEA HOW TO . ..................
//tried doing something like this, for a work around
$newargs = implode(",", $args);
//Call Another Function
anotherFUnction($newargs); //This function is however a constructor function of a class
//^This is regarded as one arguments, not mutliple arguments....
}
我希望這個問題是清楚了吧,什麼是周圍的工作對於這種情況說明問題嗎?
更新
我忘了提,我打電話的下一個函數是一個構造類另一個類的。 喜歡的東西
$newclass = new class($newarguments);
發送其餘的參數作爲數組不是可接受的解決方案。我想發送參數的方式與「arg [1],arg [2] ..等等一樣...... – Starx