PHP Syntax

The first step is to escape from HTML and into "PHP code mode". There are 4 ways to do this:

  1. <? echo ("An SGML processing instruction\n"); ?>
    (only available if short tags have been enabled )
     
  2. <?php echo("version for serving XML documents\n"); ?>
     
  3. <script language="php">
    echo ("version for editors (like FrontPage) that don't like processing instructions"); </script>
     
  4. <% echo ("ASP-style tags. Support for these was added in 3.0.4."); %>
    <%= $variable; # This is a shortcut for "<%echo .." %>
    (only available if ASP-style tags have been enabled)

If there is a newline immediately trailing the closing "bracket" for the block, it will be included.

Back to top     Home     Serious Stuff

© 2001. Copyright Sue Nethercott.