PHP: Echo function output in function-line, not line of function call
- by Brill
I have a problem with my self-coded template system. The content is inserted by Include(). Now I need to add a meta redirect to one page. I know, meta redirect is not the safest way, but I need it because of it's delay possibility.
Now i'm looking for a way to influence the wrapping page (template) by the wrapped page (content).
So I thought a function can do this job.
<?php function test($testvar){
echo $testvar;}
?>
<hr />
<?php
test("testtext");
?>
Of course the text echos in the line of the function call, not in the function line. Is there a way to make the function echo in the line of the function itself? In this case above the horizontal rule, not below?
Of course every other best pratice for this "template problem" ist welcome!
THX