HTML into PHP Variable (HTML outside PHP code)

Viewed 39020

I am new to php and wondering if I can have something like this:

<?php
 ...
 magicFunctionStart();
?>

<html>
   <head>...</head>
   <body>...</body>
</html>

<?php
 $variable = magicFunctionEnd();
 ...
?>

What I have to use right now is

<?php
 ...
 $variable = "<html><head>...</head><body>...</body></html>"
?>

Which is annoying and not readable.

7 Answers
$html_content = '
    <p class="yourcssclass">Your HTML Code inside apostraphes</p>
';
echo $html_content;
Related