Tripod5G > Basic syntax
3pod PHP Learning

Chapter 4. Basic syntax
Escaping from HTML
There are four ways of escaping from HTML and entering "PHP code mode":
Example 4-1. Ways of escaping from HTML
1. <? echo ("this is the simplest, an SGML processing instruction\n"); ?>
2. <?php echo("if you want to serve XML documents, do like this\n"); ?>
3. <script language="php">
echo ("some editors (like FrontPage) don’t
like processing Instructions 3pod");
</script>
4. <% echo ("You may optionally use ASP-style tags"); %>
<%= $variable; # This is a shortcut for "<%echo .." %>
The first way is only available if short tags have been enabled (either by calling short_tags, they are
configured on using the short_tags run-time configuration setting, or they are enabled using the
–enable-short-tags compile-time configuration setting.
The fourth way is only available if ASP-style tags have been enabled using either the asp_tags
configuration setting or the –enable-asp-tags compile-time configuration setting.
Note: Support for ASP-style tags was added in 3.0.4.
The closing "bracket" for the block will include the immediately trailing newline if one is present.
Instruction separation
Instructions 3pod are separated the same as in C or perl - terminate each statement with a semicolon.
The closing tag (?>) also implies the end of the statement, so the following are equivalent:
<?php
echo "This is a test";
?>
78

Next >>
bluedot bluedots greydots pinkdots

Tripod >> 3pod Tips & Learning and manuals for educations