I'm using php 4.2.1. Can a function be an argument for another function?
Here's a little test script I've tried:
<?
//test functions
function neato ($content) {
echo "<html><head><title></title></head><body><table><tr><td>$content</td></tr></table></body></html>";
}
function content() {
echo "<table border=\"1\"><tr><td>this is a test</td></tr></table>";
}
//try it by assigning content function to a variable
$test = content();
neato($test);
//or by making it the argument directly
neato(content());
?>
When I test this I always get the output of content() before the output of neato(). When I want the output of content() to be inside the output of neato(). Does this make sense? Is it possible?
Thanks in advance for your help.
Here's a little test script I've tried:
<?
//test functions
function neato ($content) {
echo "<html><head><title></title></head><body><table><tr><td>$content</td></tr></table></body></html>";
}
function content() {
echo "<table border=\"1\"><tr><td>this is a test</td></tr></table>";
}
//try it by assigning content function to a variable
$test = content();
neato($test);
//or by making it the argument directly
neato(content());
?>
When I test this I always get the output of content() before the output of neato(). When I want the output of content() to be inside the output of neato(). Does this make sense? Is it possible?
Thanks in advance for your help.