svn: /phpdoc/en/trunk/language/ basic-syntax.xml
| From: | Karma Dordrak | Date: | Thu, 15 Mar 2012 11:38:13 +0000 |
| Subject: | svn: /phpdoc/en/trunk/language/ basic-syntax.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-9895@lists.php.net to get a copy of this message | ||
drak Thu, 15 Mar 2012 11:38:13 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=324268
Log:
Apply coding standards and reword explanations.
Changed paths:
U phpdoc/en/trunk/language/basic-syntax.xml
Modified: phpdoc/en/trunk/language/basic-syntax.xml
===================================================================
--- phpdoc/en/trunk/language/basic-syntax.xml 2012-03-15 09:49:21 UTC (rev 324267)
+++ phpdoc/en/trunk/language/basic-syntax.xml 2012-03-15 11:38:13 UTC (rev 324268)
@@ -56,20 +56,22 @@
]]>
</programlisting>
</example>
- This works as expected, because when PHP hits the ?> closing
+ This works as expected, because when the PHP interpreter hits the ?> closing
tags, it simply starts outputting whatever it finds (except for an
immediately following newline - see
- <link linkend="language.basic-syntax.instruction-separation">instruction
separation</link>
- ) until it hits another opening tag unless PHP is in the middle of a conditional statement. See
the
- next example.
+ <link linkend="language.basic-syntax.instruction-separation">instruction
separation</link>)
+ until it hits another opening tag unless in the middle of a conditional
+ statement in which case the interpreter will determine the outcome of the
+ conditional before making a decision of what which to skip over.
+ See the next example.
</para>
<para>
- You can also use more advanced structures with conditions
+ Using structures with conditions
<example>
<title>Advanced escaping using conditions</title>
<programlisting role="php">
<![CDATA[
-<?php if( $expression == true ): ?>
+<?php if ($expression == true): ?>
This will show if the expression is true.
<?php else: ?>
Otherwise this will show.
@@ -81,14 +83,13 @@
though they are outside of the PHP open/close tags, PHP skips them according
to the condition since the PHP interpreter will jump over blocks contained
within a condition what is not met.
- </para>
- <para>
- The example given here is contrived, of course, but for outputting large
- blocks of text, dropping out of PHP parsing mode is generally more efficient
- than sending all of the text through <function>echo</function> or
- <function>print</function>.
</para>
<para>
+ For outputting large blocks of text, dropping out of PHP parsing mode is
+ generally more efficient than sending all of the text through
+ <function>echo</function> or <function>print</function>.
+ </para>
+ <para>
There are four different pairs of opening and closing tags
which can be used in PHP. Two of those, <?php ?> and
<script language="php"> </script>, are always available.