PHP is the *P*HP *H*ypertext *P*reprocessor. Use it:
<?php
…
?><a href="#">#</a><?php
…
<?php
…
?>
(Insert line-breaks where convenient, but be aware that they result in
whitespace text nodes which in turn may result in a space character being
displayed. Consult the HTML 4.01 Specification for details.)
This approach (stdin – parse – stdout) wins over a here-doc string in almost
all cases, as by contrast the ending delimiter of a here-doc string must be
at the first column (so is not easy to indent), can only be followed by at
least a semicolon (which means concatenation for more complex expressions),
and requires escaping of some characters that do not have to be escaped with
the approach above.
Incidentally, it is described and recommended by one of the first chapters
of the PHP manual:
<
http://php.net/manual/en/tutorial.firstpage.php>
It should also be noted that PHP 5.4 does away with the nonsense that
`<?= … ?>' would not be working with short_open_tag=Off (which required you
to write `<?php echo …; ?>' instead), so there is no good excuse left to
`echo' *everything* (instead of just the dynamic parts) rather ineffiently:
<
http://php.net/ChangeLog-5.php>
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <
http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)