問題:
I've been wondering whether is possible or not to pass a function as parameter in PHP;我一直想知道是否可以在 PHP 中將函數作爲參數傳遞; I want something like when you're programming in JS:當你用 JS 編程時,我想要這樣的東西:
object.exampleMethod(function(){
// some stuff to execute
});
What I want is to execute that function somewhere in exampleMethod.我想要的是在exampleMethod中的某處執行該函數。 Is that possible in PHP?這在 PHP 中可能嗎?