I was wondering, mostly because I think I've w3coded code html seen it before somewhere, if it is possible to w3coded code html store HTML within a variable, something like the w3coded code html following (I know this makes no sense, it's just w3coded code html to clarify my question):, w3coded code html Stack Overflow for w3coded code html Teams Where w3coded code html developers & technologists share private w3coded code html knowledge with coworkers w3coded code html , w3coded code html w3coded code html This is the one I was w3coded code html looking for, heredoc solves my problem as well w3coded code html but leaves the code colored like php in w3coded code html Dreamweaver which was one of the reasons I w3coded code html wanted this. w3coded code html – Kokos Jun w3coded code html 9 '11 at 13:57 w3coded code html w3coded code html , w3coded code html w3coded code html @Felix Kling, what I w3coded code html want to use this for is for newsletter templates w3coded code html that require a php configuration for my system w3coded code html as well as a HTML template. I'd like these two w3coded code html to be included in the same php file without w3coded code html losing my HTML syntax coloring. I figured this w3coded code html was a great solution. w3coded code html – Kokos w3coded code html Jun 9 '11 at 14:26 w3coded code html
You could do that using output buffering. Have a look at the examples at ob_get_contents() and ob_start().
<? ob_start(); ?>
All kinds of stuff, maybe some <?= "php"; ?> etc.
<? $var = ob_get_contents(); ?>
You may be thinking of the Heredoc syntax:
<?php
$var = <<<EOD
text goes here
EOD;
?>
Last Update : 2023-09-22 UTC 12:21:05 PM
Last Update : 2023-09-22 UTC 12:20:48 PM
Last Update : 2023-09-22 UTC 12:20:31 PM
Last Update : 2023-09-22 UTC 12:20:25 PM
Last Update : 2023-09-22 UTC 12:20:09 PM
Last Update : 2023-09-22 UTC 12:19:34 PM
Last Update : 2023-09-22 UTC 12:19:15 PM