Embedding HTML or Dropping out of PHP?
Posted: Tue Dec 07, 2004 6:22 pm
I prefer dropping out of PHP so I don't have to worry about escaping quotes, but I was browsing the source code of phpMyAdmin and saw a cool way to embed it if needed.
It works fine and looks great. Just wanted to show that to people who might not have seen that done before. What do you guys think? Also when using the constant NewLine, one get can rid of all the carriage returns to save bandwith in production mode.
Code: Select all
<?php
$Header = ''
. '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' . NewLine
. '<html>' . NewLine
. '<head>' . NewLine
. '<title>' . $MyData['WebPageTitle'] . '</title>' . NewLine
. '<link rel="stylesheet" type="text/css" href="style.css">' . NewLine
. '<meta name="MSSmartTagsPreventParsing" content="true">' . NewLine
. '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">' . NewLine
. '</head>' . NewLine
. '<body>' . NewLine
. '<table cellpadding="2" cellspacing="0" border="1" width="100%">' . NewLine
. ' <tr>' . NewLine
. ' <td align="center">HEADER</td>' . NewLine
. ' </tr>' . NewLine
. ' <tr>' . NewLine
. ' <td>' . NewLine;
?>