[snip]
...lots of stuff from lots of messages...
[/snip]

If you need to display PHP code in an HTML page and have it validate
properly you need to use the following;

<? php ?> which will properly display as
<? php ?>

As a matter of course it is typical to use &lt; (<) and &gt; (>) along with
a set of pre-formatted tags (<pre></pre>) when using HTML to display code.
Many online magazines have adopted this syntax for code display. Therefore;

<pre>
&lt;? php
//lots of code here
if(foo == bar){
        do some stuff;
        }
else {
        do other stuff;
        }
//now do some HTML
print("&lt;title&gt;" . $title_variable . "&lt;/title&gt;")
?&gt;
</pre>

will display the code block and its comments properly in an HTML page.

HTH!

Jay



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to