Sophie

Sophie

distrib > PLD > ac > amd64 > media > dist > by-pkgid > dd8ef74e7a184506d40e4328053fb785 > files > 3764

php-manual-ro-20051028-1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>if..endif syntax</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Manual PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Migrating from PHP/FI 2 to PHP 3"
HREF="migration.html"><LINK
REL="PREVIOUS"
TITLE="Start/end tags"
HREF="migration.startendtags.html"><LINK
REL="NEXT"
TITLE="while syntax"
HREF="migration.while.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-2"></HEAD
><BODY
CLASS="section"
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"
>Manual PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="migration.startendtags.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Anexa D. Migrating from PHP/FI 2 to PHP 3</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="migration.while.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="migration.if-endif"
>if..endif syntax</A
></H1
><P
>&#13;   The `alternative' way to write if/elseif/else statements, using if();
   elseif(); else; endif; cannot be efficiently implemented without
   adding a large amount of complexity to the 3.0 parser.  Because of
   this, the syntax has been changed:
   <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN132802"
></A
><P
><B
>Exemplu D-5. Migration: old if..endif syntax</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
if ($foo);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo "yep\n";<br />elseif ($bar);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo "almost\n";<br />else;<br />&nbsp;&nbsp;&nbsp;&nbsp;echo "nope\n";<br />endif;</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
   <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN132805"
></A
><P
><B
>Exemplu D-6. Migration: new if..endif syntax</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
if ($foo):<br />&nbsp;&nbsp;&nbsp;&nbsp;echo "yep\n";<br />elseif ($bar):<br />&nbsp;&nbsp;&nbsp;&nbsp;echo "almost\n";<br />else:<br />&nbsp;&nbsp;&nbsp;&nbsp;echo "nope\n";<br />endif;</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>

   Notice that the semicolons have been replaced by colons in all
   statements but the one terminating the expression (endif).
  </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="migration.startendtags.html"
ACCESSKEY="P"
>Înapoi</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Acas&#227;</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="migration.while.html"
ACCESSKEY="N"
>Înainte</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Start/end tags</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="migration.html"
ACCESSKEY="U"
>Sus</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>while syntax</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>