【发布时间】:2020-05-07 15:24:52
【问题描述】:
是否可以将非变量的内容传递给 PHP 函数,例如循环或类似构造,以在另一个函数中执行。
这是一个 php 版本,说明如何在 javascript 中完成。
function myFunction($content){
// something important that needs to be done before content
$content
// something important that needs to be done after content
}
myFunction({
foreach($things_we_have as $key => $val){
// Things to do in centre of the function
}
});
显然这不起作用。可以这样做吗?如果可以,怎么做?
【问题讨论】: