Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 0afeee9cca140e167a996902b9a677c5 > files > 2973

php-manual-en-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>Comments</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="index.html"><LINK
REL="UP"
TITLE="Basic syntax"
HREF="language.basic-syntax.html"><LINK
REL="PREVIOUS"
TITLE="Instruction separation"
HREF="language.basic-syntax.instruction-separation.html"><LINK
REL="NEXT"
TITLE="Types"
HREF="language.types.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="language.basic-syntax.instruction-separation.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 6. Basic syntax</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="language.types.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="language.basic-syntax.comments"
></A
>Comments</H1
><P
>&#13;    PHP supports 'C', 'C++' and Unix shell-style comments. For example:

    <DIV
CLASS="informalexample"
><A
NAME="AEN3153"
></A
><P
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>&#60;?php
    echo "This is a test"; // This is a one-line c++ style comment
    /* This is a multi line comment
       yet another line of comment */
    echo "This is yet another test";
    echo "One Final Test"; # This is shell-style style comment
?&#62;</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
>
   </P
><P
>&#13;    The "one-line" comment styles actually only comment to the end of
    the line or the current block of PHP code, whichever comes
    first.
   </P
><DIV
CLASS="informalexample"
><A
NAME="AEN3156"
></A
><P
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>&#60;h1&#62;This is an &#60;?php # echo "simple";?&#62; example.&#60;/h1&#62;
&#60;p&#62;The header above will say 'This is an example'.</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>&#13;    You should be careful not to nest 'C' style comments, which can
    happen when commenting out large blocks.
   </P
><DIV
CLASS="informalexample"
><A
NAME="AEN3159"
></A
><P
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>&#60;?php
 /* 
    echo "This is a test"; /* This comment will cause a problem */
 */
?&#62;</PRE
></TD
></TR
></TABLE
><P
></P
></DIV
><P
>&#13;    The one-line comment styles actually only comment to the end
    of the line or the current block of PHP code, whichever comes first.
    This means that HTML code after // ?&#62; WILL be printed: ?&#62; skips out of
    the PHP mode and returns to HTML mode, and // cannot influence that.
   </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="language.basic-syntax.instruction-separation.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="language.types.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Instruction separation</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="language.basic-syntax.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Types</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>