Is it possible to pass content that are not variables to a PHP function such as a loop or similar construct to be executed in the other function.
Here is a php version of how it can be done in 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
}
});
Obviously that does not work. Can this be done and if so how?