Reputation: 1450
What's that feature of PHP where you have, say a "start" bit of code, then some html or text that would normally send to the browser, then a bit of code to "end" it?
For example,
<? start_something(); ?>
<html>some html</html>
<? end_something(); ?>
Yes, this is a built-in feature of php and I am sure of it, but I cannot remember what it's called.
Upvotes: 0
Views: 60
Reputation: 1
Pretty sure you're asking about output buffering, as mentioned in other answers
Upvotes: 0
Reputation: 13
Is this what you need: http://php.net/manual/en/control-structures.alternative-syntax.php
Upvotes: 0
Reputation: 2286
Take a look at PHP documentation for print()
print <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon no extra whitespace!
END;
Upvotes: 0
Reputation: 227280
<? ob_start(); ?>
<html>some html</html>
<? ob_end_flush(); ?>
Upvotes: 0
Reputation: 219864
Typically this is how many websites apply a common header and footer to their web pages. By separating them into separate files and including them in each page they can easily maintain a consistent look and feel to their website all while making maintaining it easy since they would only need to update one or two files to change the appearance of the entire site.
Upvotes: 0
Reputation: 21830
buffer?
ob_start();
//do some code
ob_flush(); //sends current code to browser
//do something else
ob_end_flush(); //or ob_end_clean()
Upvotes: 4