The second example should work, except you said <php
instead of <?php
philfreo
2009-12-09 22:14:51
The second example should work, except you said <php
instead of <?php
There is no correct way. Outputting HTML within a switch is the same as outputting it anywhere else.
There's no correct way perse, both should work.
In your first example you need to make sure there is no space between <<< and EOM and no semicolon afterwards.
Example:
$myvar = <<<END
<div>My html here</div>
END;
echo $myvar;
another option would be to use:
echo "<div>My html here</div>";