下面是一行代碼我使用:如何將參數傳遞到call_user_func
$json[JsonConstant::JSON_CUSTOM] => call_user_func(array($this, $customTypes[$customDownloadType])),
$customTypes[$customDownloadType]
可能會解決到類似getTags()
。
但是,如果我想將參數傳遞給getTags()
,我該怎麼辦?例如,假設我有一個名爲$time
的變量,我想傳入?我該怎麼辦?
看來我想要從http://php.net/manual/en/function.call-user-func.php的例子2和4的混合物 - 這是可能的嗎?
感謝