Software Sue

Link to Simply Sue
Link to Sustainability Sue
location: software/scripting/php syntax Skip navigation : Home  

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.