Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Dilema, Blocks of HTML within PHP
February 13, 2005, 5:02 am
rate this thread
I need to be able to have a large block of HTML code inside a PHP
document, assign it a variable, and use other variables, functions, and
objects within the HTML code still.
I have the following code (as an example):
$variable = <<<HTML
I need to be able to do that ^, that actual code wouldn't work, but it
is an example of what I need to do. I have tried searching for the <<<
operator, or whatever it is, the problem is most search utilities won't
recognize <<<, so it is really really hard to search and find answers
about it, I can't find anything about it on the php manual, I'm falling
onto a last resort by posting on some forums to see if anyong is able
to help me.
So question being really:
Is there a way I can split that so it recognizes those lines as PHP and
not part of the block of HTML code
Is there another method that I can use to achieve this same effect ?
I have to be able to keep the block of code together, not seperating
each line into a variable declaration. such as:
$var = "<tr><td>" . $text . "</td></tr>";
$var .= "<tr><td>" . echo $config->getBlah(); . "</td></tr>";
Do NOT want to do that.
So if anyone has any ideas/solutions, please, please let me know :)